I think people need to stop seeing the Catholic Church as an inherently good or bad thing. It's not inherently good or bad. It's a business, a business that is allowed to use sales techniques that I would be fired for. It's going to do what it sees is in its best interest, and ultimately its goals are to gain market share ("souls"). To do this, it does "good" for the community (whether subsidized housing is good for anyone is a matter of debate and imo is not a good thing). By doing such "good" things, it gains followers. It also gives its followers something to do, which is why they are church members in the first place - to fill a hole in their lives, something they are missing or something that is wrong with them, and to make them feel like their life has a purpose. Such "good" things also get them donations.
To clarify, the church is more of an oligopoly than a business. And as such, it can afford to cover up scandals and allow them to go on - because it knows that if they are exposed, they will pose little threat to their "market share".
^ Just my extremely cynical personal views.