The costs of races has gone up far beyond the cost of living for many reasons, and not for "prize money" reasons. Look at just the technical costs, from having split mats at every 1 mile or 5 km (someone has to buy those, put them there, link the timing systems, often hire extra timers from out of state, etc. A full-time paid race director AND staff (can't be a volunteer when thousands are running and not dozens). Boston and many other cities HAVE to pay not only police services but also the folks that set up barricades, fencing, etc., and take away all the trash, then the costs of renting an expo location and hiring the managers for it, updating web services, hiring an event manager/s who link up with sponsors that can be connected with the event (Adidas with Boston, Asics with NYC in the past and now NB, NIKE with Chicago, Hoka with Grandma's, etc.), hired medical personnel and management, etc. No longer is Boston the domain of Jock Semple and stew at the finish line. Just cannot occur when tens of thousands are running, and now there's the added risks/costs d/t crazies that want to terrorize for crazy agendas.
Boston has to pay ALL the cities on the course for the city services tied into running through their cities, and that is a BIG cost, no donations from any of the cities involved.