I had this issue, and tried the suggestion posted by Swish17 here https://discussions.apple.com/thread/3201921?answerId=15704990022#15704990022
Even though this is an old post from when they upgraded to Lion, it worked. It took a while for everything to reindex, but after it was done, mail badge was back.
1. Quit Mail if it’s open.
2. In ~/Library/Mail/V2/MailData, delete any file that begins with “Envelope Index,” such as Envelope Index or Envelope Index-shm.
Your home Library folder is hidden by default. To display it, choose Finder > “Go to Folder” and then enter “~/Library.”
3. Open Mail.
Mail creates new Envelope Index files. This process may take a few minutes, depending on how many messages Mail is reindexing.