"YouTube is still not profitable." Are you sure?
Youtube or other platforms may not make strong profits themselves, but contribute strategically or operationally to the overall Alphabet bottom line.
So the discussion here is not 'Is Youtube making a profit' but 'Does Youtube contribute, directly or indirectly, to the overall Google/Alphabet enterprise strategy?'. In that case, it is entirely possible for major acquisitions to not appear to be 'for the money' but are still essential in driving shareholder value.