Speculating here, but I don't think Google wanted Groupon as an immediate profit center. They wanted their considerable mindshare and ready-made sales and marketing team. I'm guessing that they felt they could merge Googles ability to optimize with that juggernaut and build something to just dominate the local marketing space (particularly the real time stuff).
It's relative. Google has piles of money and the means of making more; if they make a mistake in spending their pocket change, it's no biggie. But Groupon has piles of debts, and their runway is getting shorter.
I think Google was willing to pay way more than they should have for Groupon, but I wouldn't call it anywhere near the dumbest thing a company could do.