The latter. Once you're in medical school, nobody cares about your undergrad, it's irrelevant.
I would disagree that your medical school doesn't matter at all for residency selection for two reasons. First, the residency directors themselves admit that it is a factor. It's down on their list, but it's still there. A highly regarded medical school could help tip the odds in your favor among similar applicants on the rank list. Though I probably wouldn't turn down a large scholarship from another quality school to attend an elite one. The military match system gives you extra points for attending an elite medical school.
And second, not all medical schools are created equal, no matter what you read on SDN. Medical schools that are affiliated with globally known, full service, quaternary care referral centers can give you better opportunities for research, etc IF you have the initiative to take advantage of them. You could also have access to LORs from leaders in your desired field which could improve your application. An unusual and challenging patient population is also very interesting. It's one of the reasons that I chose to work where I work.
When it comes down to money/debt and if one school is any better then another, it's really up to you to determine what you would be willing to pay and if there is likely to be much difference between your available opportunities.