I've done it. You've done it. Hell, anyone with an office job has found themselves roped into an embarrassing-for-all rendition of the world's most recognized song. How could such an innocent celebration of a loved one's birthday be illegal?
It all started in 1935 when "Happy Birthday to You" was copyrighted by the Birch Tree Group Limited. In 1988 a division of the Warner Music Group acquired Birch Tree and began collecting around $5,000 a day in licensing fees for the song.
This is why you'll so rarely hear complete versions of "Happy Birthday" in movies or TV shows. Most productions will either cut the song so short that it doesn't violate copyright, or simply substitute a public-domain option like "For He's a Jolly Good Fellow".
No matter how you slice it, under current copyright rules, every time you sing "Happy Birthday to You" in public, you're breaking the law.