Universities (especially public universities) have almost an infinite amount of money to spend. Their budget is backed by the state so they can essentially request as much as they want. The only question is do they want to spend the money? The answer is usually no. In this case they decided Vin was worth it.
States are most definitely not just throwing money at their universities.
You are completely right. Anyone who thinks public universities have an "infinite amount of money to spend" because "their budge is backed by the state" so they can "request as much as they want" has not been keeping up with current events. State share of public research university revenue has been shrinking for decades. In most places, states now provide less than 10% of the revenue for their most prestigious schools. UVa appears to be at the low end of that spectrum -- five years ago, they got under 6% of their total revenue from the state .
When combined with rising costs, the falling support from state governments has led many flagship state schools to raise tuition. And, since out-of-state students pay much more than in-state students, many public schools have also begun to admit more out-of-state students.
TL:DNR: It's been a long time since public universities could print money.