The All-Star game has only very recently determined World Series home field advantage. This began after the 2002 Major League Baseball All-Star Game, which ended in a 7-7 tie after both teams had used up their available pitchers. (While a regular season or playoff game would continue either extending pitchers or using position players as needed, in an exhibition game this would be unfair to the players and the teams they represent.)
After that game, complaints arose that the managers were not attempting to win the game, and instead simply go through the motions to allow everyone a chance to play. A major theme was that the game was irrelevant, and so why would anyone try particularly hard, particularly the manager?
Additionally, Bud Selig (then the MLB commissioner) was at the game and was a former owner of the hosting Milwaukee Brewers, and some felt that made it seem worse, as his family still owned the team at the time (though the Brewers had nothing to do with the all-star game, other than sending a single player as all teams did).
As a result, the pressure caused Selig and the MLB executives to change the rules so that in 2003 (and hence), the winning league in the All-Star game has homefield advantage in the World Series. Prior to this, homefield advantage had alternated between the leagues.
"This Time It Counts" was the slogan of the 2003 All-Star game (and continued afterwards for years). It was designed to show fans that a repeat of the 2002 game would not be tolerated.
In the 2002 game, the reason they ran out of pitchers was that the manager attempted to get every player into the game that was possible. Most years this wasn't a big deal; however, a couple of specific issues conspired to cause the tie.
First, Joe Torre and Bob Brenly were both old-school managers who believed in starting all of the players they could. They both also were respectful of the other managers in the league and were uninterested in stretching pitchers out any longer than needed (both to avoid injury and to avoid making them unavailable to pitch later on).
Second, teams typically carried only nine or ten pitchers, on the basis of the fact that you could get more players in the game that way. Nine pitchers leaves one pitcher to pitch each inning of the game, and while one or two were typically held out in reserve, more would be difficult to get into the game as most all-star pitchers do not want to only get one or two outs. For hitters you could simply swap the entire team out midway through (8 hitters, two times, and a few left in reserve).
To address these issues a few additional rules were added after 2002.
- Rosters were expanded, from 30 (2002) to 32 (2003) eventually to 34 (2010).
- Catchers may re-enter the game if the last catcher must leave the game due to injury.
- Managers have been instructed to hold back a few players (both pitchers and position players) to ensure enough players are available.
- (2010) A single position player other than catcher may re-enter the game if the last position player leaves due to injury.
- (2010) The Designated Hitter is used in all All-Star games; prior the DH only was used in AL-hosted games.
See Wikipedia's All Star Game entry and this ESPN Article on the rules changes for 2010 for more detail.