There is more randomness in an individual baseball game that necessitates a longer season to crown a winner. Football teams have gone undefeated during the regular season. The best regular season basketball teams of all time have won close to 90% of their games. The baseball team with the most regular season wins in the last century had a record of 116-46 for a winning percentage of just under 72%.
There is and old baseball saying that no matter how good you are, you're going to lose one-third of your games. No matter how bad you are you're going to win one-third of your games. It's the other third that makes the difference.
40 games simply wouldn't be enough to figure out which teams are actually good.