The main reason it limits the size of each class is simply space. Since passing the (idiotic) "Freshmen on campus" rule several years ago, MIT has to have room for every member of its freshman class in its 11 dormitories. This caused it to cut the size of each class from about 1100 to 1000. Though, even before that, housing of some sort (dorm, frat/sorority, or independent living group) was guaranteed for four years (as it still is), so there were still limits. And trust me, in a housing market like boston/cambridge, guaranteed housing is important - if you think $45K/ year is expensive, try multiplying your housing costs by 4 or 5.
Though they also have very generous financial aid, which is getting more generous every year, so only the wealthiest students are actually paying the full $45K. I had a yearly required family contribution of near $0, and I have more loans from my two-year master's program (at a public school) than from my 5 years of undergrad at MIT.