It's quite possible (indeed, likely) that this is a good thing for your privacy (albeit at the expense of your expectations).
The command for a developer to update the badge is basically "for this Apple ID, set the badge number on my app to
x". The command to send you a message-based push notification in general, however, is basically "for this Apple ID, send this message on behalf of my app".
You notice the two things are managed discretely. In neither case does the app itself get opened (normally), so it can't total the received messages and update the badge (like Mail does). There's a mechanism in iOS 7 for apps to run periodically in the background and check for updates, but it's relatively new.
If the app wanted to keep the notification count and the badge in sync, they'd have to keep track of a count of all the notifications they've sent to your device, and whenever you clear them send a reset message up to the server to say "this user has now viewed all their notifications", and whenever that number changes, send the update badge number command back to Apple to send to your phone. For some apps that are driven by notifications like WhatsApp or Facebook Messenger, that's reasonable, so they do exactly that. On a game, it's not generally necessary to keep track of whether or not you viewed a notification. Instead, they just set the badge number to 1 when they send you a notification and clear it when you open the app.
Even when it makes sense to try to keep the badge number correct, it's not always technically possible. When you choose to clear all your notifications for a given app in the notification centre, nothing gets sent back to the developer or the app to let them know. Which means they don't send the command to your phone to remove the app badge.
This issue could be solved relatively easily if Apple provided the ability to show the badge without any number inside it, but (for now) they don't provide that function to third-party developers.