If not then it's still the same question: how does the UK benefit from having the royal family allowing this rather than just some other entity that owns the land and rents it out at low cost? Why does that entity need to be a monarchy?
Mostly: tourism. The royal family is widely thought to bring in a lot more than it costs.
Also, they provide a lot of face-time for the government. They show up at a lot of events, the kind of thing for which you might hire a celebrity to give it a sense of occasion. The actual dollar value of that is hard to estimate, and it's less valuable than the tourism, but the fact that people still want it suggests that it's providing something of value.