There are many factors at work here. The various studies all have flaws as there are many interrelated variables and they are difficult to separate out. There is a complex choice here, and it is never as simple as these studies or stories make it out to be. Some things that are typically omitted:
1) If your undergraduate degree is the last degree you are going to get, the importance of that institution is elevated somewhat.
2) If you plan to get an advanced degree, one main goal of undergraduate education is to increase the likeliehood that you will get into a top graduate program and do well there.
2b) Top graduate programs in science and engineering are much more likely to take strong students from research universities, particularly those undergraduates who already took some graduate-level courses or had specific productive experience with undergraduate research.
Expounding a bit:
1) For careers in finance or management, many strong firms only consider students from very strong universities. If that is your career path, that could be an important criterion. Similarly, if your only degree will be undergraduate in some other field where generally the expectation is just an undergraduate degree, that choice of institution of course matters more. In terms of studies that look at average salary, this effect can dominate others as these are often high-paying fields with great variance in salary.
2) In general, I recommend that good students go to the "best" place that they get into. That is, the most academically rigorous usually works well. Overdoing it can be a problem, if they go to a place where the expectations are simply to high and they struggle and fail. But most commonly, the advantage of going to a strong place is that the other students are also strong, and the professors can then teach at a reasonable level for their audience. That is, often the other students are the limiting factor to the depth of a course's coverage and so you want to be at the best place you can be and still succeed. That is a good route to the preparation needed for doctoral-level courses.
2b) I've had to serve on various doctoral admissions committees, and students from big research universities are much more known quantities. Professors at these institutions have more experience with students continuing on to graduate school (and seeing their own students and other graduate students in their departments) and the students have a pretty good idea of what they are getting into. There have been too many students from small liberal arts colleges, whose letters of recommendation said "this is the best student I've seen in years" who took all the available courses there and excelled grade-wise, but who struggled and turned out to be poorly prepared or just overwhelmed by doctoral level work, or simply didn't really realize what they were getting into. So occassionally there are students from such backgrounds who do OK, but it isn't common and I can't recommend it as a good route to a strong graduate program. It may be the case that their smaller college instructors there are more involved in their teaching, classes are smaller, facilities are better, and they may in fact actually learn more at their institution and be happier there, but that doesn't really carry much weight for eventual graduate study.
FWIW, I went to an elite US research university for my undergraduate, and went to a top US research university for my PhD. I have taught or held research appointments post-Ph.D. in a wide range of institutions, from one of the weaker Ivy League institutions to top tier public research universities to mid-tier public research universities and I have a strong record of research funding as a professor judged primarily on research. People from many backgrounds ask for my advice about university choices in science and engineering as there is a culture of excessive obsession about "the right institution" for their choice.