Hospitals can stimulate the economy by providing jobs, but if there isn't private sector growth there will be less money anyway. Events like these bring in millions of tourists, which is a huge huge industry. As said it also helped pave the way for Rio Olympics, and frankly it was an excuse to partially crack down big time on the slum area's for criminals.
It's not great and like probably every public works in every country(with mostly bent politicians) there will be millions, billions in wasted money, inflated contracts to friends of politicians, it's the way the world works.
The rioting people really don't know what they are doing, the best thing for Brazil is to put a pretty face on the tournament, make Brazil seem lovely and persuade people to come visit, spend a few thousand on food, hotels, tourist attractions, it all means tax money, jobs and income. Rioting when the camera's are on when you're trying to effectively get worldwide advertising, is massively counter productive.
Thing is, most public works are a complete crap shoot, and many are disasters. At least there are some positive things, many many countries, particularly ours, waste billions on crappy things like ID schemes and failed NHS systems. The rail network, while expensive and flawed is being built with the intention of making somewhere out of London, which is frankly well beyond capacity, a viable city for business growth and population growth/commuting.
Media generally try and portray say a world cup as a short term thing that for some reason should pay back in profits instantly, and say because it doesn't it's a waste. They also highlight how much Fifa make, a couple billion, but there is effectively their entire budget(which isn't tiny) for 4 years, with every other tournament, under 21's, confed cup, womens cups, youth cups, all making losses. IIRC South Africa got around 650million, another 450million went on prize money, and Fifa got about 2 billion. THey invested a good portion of it and then like every single good non profit, they had a huge expenses budget....

Charity has been very profitable for those running them for a very long time, look at the catholic church. But it is still unfair to portray Fifa like it's pure profit, they give nothing back and they pocket it all, they pocket an unhealthily large amount, reinvest loads and spend a pretty huge chunk on the actual world cup itself.