If Costco decided they wanted to make a profit on their 1.50$ hot dogs and cranked the price up to 3$, they would lose a ton of goodwill and many of their loyal customers would be upset.
Google isn’t exactly struggling to make ends meet. They seem perfectly okay to be losing money on search. YouTube is no different.