Thanks for reporting this. You were right, the cap was wrong.
The flag cap is 40 per active member, and "active" means you've played in the last 7 days. The game was only noting that you'd played when you signed in with your password. If the app kept you signed in, you stopped counting after a week, even if you played every day. That's why your cap kept moving between 80 and 120.
It's fixed now. Everyone who plays counts as active, and your kingdom's cap should go up as soon as your members log in.