Actually making no profit, but at the same time not losing money is "good enough" for a company like Google. The massive amount of users allows for analyzing behavior patterns and increasing the profile information that later on is used to improve targeted ads like adwords.
Not only this, but being able to have a larger pool of employees without losing money has its own benefits, like easily reallocating the best performing or fitting people on other, more profitable projects or urgent problems.