I think the actual answer is "because it can"...it's really that simple.
Supply and demand dicate how much colleges can charge students, nothing else. If schools can charge $30k/year, and fill up the classrooms, why wouldn't they?
It's similar to the question "what's my house worth?"...the answer is exactly how much someone is willing to pay for it, nothing more and nothing less. Any real estate agent will tell you the same.
Many factors go into why colleges can charge so much and get away with it. Certainly the price distortions caused by easy-to-get guaranteed student loans is a big driver, but others exist of course.