Have you seen the plight of many of the tracks lately? They're mostly all subsidised.
The tracks are continually squeezed within an inch of their lives to host an F1 race, and the experience of attending a race has got worse over the last decade.
They are subsidised because like every large event in the world everyone involved knows full well that the economic benefit doesn't stop at the circuit limits. Hotels, taxis, transport, restaurants, etc.
This is how big business works. When the olympics are thrown, or the world cup the companies choosing to hold the event there don't think about it economically in isolation to the event, but a few million extra people who will visit London, the extra people who will fly in, book hotel rooms and pay for all kinds of other services in London. London paid say 4billion for Olympic facilities, only to gain 2billion from tickets maybe... but London itself gets another 3-4billion from increases tourist activity. If you look at the cost to throw it and the ticket sales alone it looks bad, but you can't look at it in isolation.
FIA charge X amount because the local economy(not just the track) will make a profit, the cost to bring them is shared between businesses(government/sponsors and the track itself) and the profits are shared between the same people.
If no fans show up, the track makes no money, the local hotels make no extra money, the local restaurants make no extra money and the track + local government/sponsors stop paying the FIA.
People attending is crucially important, these people pay the fees to get the race because of the economic gain, no other reason. Subsidising is just about them recognising the economic gain is greater than the tracks alone and the FIA know this and want a slice. IE the track alone might make 5mil, but the local economy will make another 5mil as well. So the FIA instead of charging the track alone 3mil leaving a 2mil profit, they charge 6-7mil, the track and the local area stump up the money and they share 3-4mil profit.