The numbers are made public because they are public - they're available to anyone who is willing to pay a commercial fee.
There are plenty of reasons why people want to know this, such as for marketing purposes and knowing what films to broadcast and when.
For a start, your question seems to be making an inaccurate assumption. You say say that normally it is bad practice to share your financial details, unless you have to: but in the case of the box office, these companies aren't sharing financial details - other companies are.
When we hear how well a particular movie has done on its opening weekend, that information isn't coming from the film's creators or distributors. It's coming from box office tracking companies. This makes complete sense. After all, you don't pay Warner Bros directly to see one of their films. You pay them indirectly, giving your money instead to a cinema, or a broadcaster, or a shop, or something similar.
In terms of box office opening weekends, for example, it will be to a cinema. There are then companies, such as Box Office Mojo and Cinema UK, who gather this information by tracking tickets sales. They then release this information, on a commercial basis, to both the film makers (who then learn how well they've done) and to any other party who is interested. Thus, the original companies aren't releasing this information. It's the data analysis companies that are.
This is the exact same case for things like the Official Charts Company in the UK, which aggregates all music sales each week. It simply looks at all downloads, purchases etc that have been made. This is independent of the music labels.
So I would argue that answers the biggest part of your question - the numbers are made public because they are publicly available.
However, there are definitely other reasons why this information has become so popular:
Much like how critic reviews are important to many cinema goers to determine if they will like a film, some fans like to know a film's box office showing. If a film is performing poorly, that will put some off. Likewise, if a film has been out for a few weeks and is still riding high, is is arguably more appealing.
It provides great marketing for films. Film studios can use this information to really publicise their film ("other people loved this, so will you!"). As @Ankit comments, they can also use this in future advertising deals.
It allows cinema chains to track how popular films are. If evidence is growing that a film's popularity is decreasing, a decision may be made to remove the film nationwide, or keep it in only certain locations. If evidence shows that a particular film is very popular at a certain time of day, a cinema could use this information and change its own scheduling of said film to the more preferable time.