They play in rain and snow (see the 2008 Phillies clinching game in the World Series) but will stop play if it gets too bad. This is for a bunch of reasons: a wet ball weighs a lot more which dramatically changes the game (mainly pitching speed/movement), a muddy field will make the ball impossible to field, a muddy field also causes players' cleats to stick which can result in serious injury when they have to stop at a base from a full sprint, hydroplaning on the outfield makes it impossible to cover that much ground to get to a ball, pitcher's control and speed are dramatically altered by cleats sticking in mud, hitting a fastball with no visibility is incredibly hard, so on and so forth. Just makes it impossible to play the game like it should be played so they wait for the rain to stop. Some modern stadiums will opt for a retractable roof because rain does affect income (ticket sales and concession money lost because people don't want to sit in inclement weather).