Why did two baseball leagues form?

The commissioner and creator of baseball, in the time Major League Baseball was organized, wanted the championship to be decided by the top teams in each league. So, they created the American League and National League. The winner of each league faces each other in the World Series to decide the champion.