King Whurdler said:
It's art, not science. Sometimes musical numbers work, sometimes they don't, and I don't see how you can make a definitive statement on them. Used properly, they can become the best part of a movie, and used poorly, they can drag it all down
Seconded. In kids' movies especially, musical numbers have the potential to work without throwing off the tone of the movie - because the logic at play is already a bit more whimsical, I guess? - but it's not 100%. With (animated, main-studio) Disney especially, songs are mostly the norm: at worst, they do an effective job of making necessary exposition entertaining, and when the songs are actually
good in addition to being entertaining (I'll Make a Man Out of You, Go the Distance, Let it Go, basically everything from The Lion King), they add something to the movie that it wouldn't have without music. But most non-Disney animated kids' films have a tendency not to take themselves seriously enough (or to knowingly not take themselves seriously, to the point of being kind of cynical) for musical numbers to feel like something that would naturally occur in the progression of things. Disney movies are trademarked by a certain type of earnestness that lends itself to songs being believable. Wreck-It-Ralph fit more in the Pixar-Dreamworks frame of mind than that of a typical Disney film, so, though there was music (and some good music, at that), it was mostly your standard background stuff, and it was never coming out of characters' mouths.
...long story short, it works when the movie has a specific tone (which Disney has largely cornered the market on) and when the music is good. Without good music, it will still work but won't be memorable (see: anything from Frozen besides Let It Go and maybe Do You Wanna Build a Snowman?), and without the right tone, it will just leave people saying "hey, that song was awesome, but what was it doing in that movie?"