Is it necessary for there to be student amenities paid for by the school? Why should tuition pay for a bunch of ancillary nice-to-haves instead of, ya know, the education?
It's not. But apparently that's what most American students demand and universities supply to satisfy the demand.
Because schools are in competition with one another to attract students (who have the ability to broadcast applications to multiple schools). The campus life factor is a major part of a student’s decision.
Put yourself into the student’s shoes. If you had the choice between two schools of otherwise roughly equal academic reputation but one offered luxurious residences while the other housed students like medieval monks, which would you choose?