From the Wikipedia entry for foul ball
This is mostly to encourage more at bats to end with a ball in play. Baseball is most exciting when a batter can put a ball in play. It also gives the batter a slight advantage in that he can continue to foul pitches that he cannot achieve solid contact with and “keep himself alive.” This balances the pitcher’s competitive advantage of knowing where the ball is going, how fast its traveling and what kind of pitch is being thrown.
In 0 and 1 strike counts the strike on a foul rule exists to advance the count and to speed up the game. Advancing the count in this case serves to add drama and keeps the batter from engaging in a long series of foul offs with no consequence.
There are however 3 situations in which a foul ball can result in an out.
- with 2 strikes any foul bunt attempt will result in a strikeout.
- with 2 strikes any foul tip that is caught by the catcher will result in a strikeout.
- in any count a ball that is fouled and caught by a fielder is a foul out.
Basically the rule exists to foster more and better competition in the sport.