To be fair, those are a few exceptions that buck a greater trend of Presidents and lawmakers almost universally attending expensive and prestigious undergrad and graduate institutions
Politicians have to be wealthy and connected, so it's not too surprising that they attend elite institutions. I see it as more of a correlation than a requirement.
That's actually a large amount of recent Presidents because Presidents are such a small group. I'm pretty sure Carter went to a state school. Reagan went to a private school that was certainly not an ivy.
We have to dig all the way back to Truman to find a President who never attended to college, so there's definitely "a greater trend of Presidents" to be college-educated.