Because on the big red double deckerbus August is beneath July (that is how I remember the monhts from my kindergarden.
Actually August was names after the Roman emperor Augustus and July after Julius Ceaser. The Roman Senate then decided that August should have 31 days, the same as July, so that Augustus doesn't seem inferior to Ceaser.
The reason for the number of days in the month is that it is how long it takes the moon to orbit the earth, which is around 28 days, months were then added or deducted during history and the above is one of the reasons.
While this doesn't have much to do with your question if you look at the last 4 months on the calendar and their Latin meanings behind the first part of each word they should be 7, 8, 9, 10. But with the addition of July and August they got bumped down 2 months, but kept their original names.
you forgot january, march may, july, augaust (never been able to spell that 1) october, and december...
but yeah as crazy said it was them roman blokes that gave the amount of days per month