They wouldn't run a subscription service that loses them money.
Most of the games they give away probably aren't selling much anymore, so publishers won't need much of a payoff in order to give it away for free. It gets fans on board for potential sequels, increases word of mouth about the game (so possibly uptick in sales) and increases sales of any DLC. It makes them a lot more money than they were making on the game before. Free games given away also benefit from increased PSN advertising, so further possibility in a sales uptick.
Obviously Sony makes money from subscriptions. They'd also make money from any sales uptick (since they take a cut of sales for the games). Not to mention PS+ discounts probably drives a lot of people to make a purchase they wouldn't otherwise make.