In truth, research rankings don't matter all that much.
However, primary care rankings don't matter at all.
When someone is talking about a top-20 school, they aren't talking about a top 20 primary care school. The reason being, if you want to land that dermatology residency, going to a research unranked school may not help you (whether it hurts you is up for debate and if it does, it's a small negative - other things matter much more than med school prestige). But if you go to Harvard and want to land a primary care residency, you're not going to be hurt. However, going to a top ranked research school with hundreds of millions of $$ will allow you many more opportunities to be at the forefront of cutting edge research, and going to 'publish-factories' will certainly help your residency. You can do research anywhere, but just the sheer number of labs and PIs at Hopkins for example will give you vastly more opportunities to find the exact type of research you enjoy and want to do compared to a less research intensive school. That's pretty much the advantage, rather than name recognition (though obviously the name does matter a little).
Fact of life is research rankings = rankings.
Again, rankings for law schools matter a lot. For med schools, they don't matter much.