If you were in Iowa when you saw this snake, it was not a water moccasin. Water moccasins, also known as cottonmouths, are not found in Iowa. Their range extends across the southeastern portion of the United States, including southern Missouri. Water moccasins are venomous and their bite can potentially be fatal. You should always observe venomous snakes from a safe distance.
Any snake can swim, but most likely you saw a northern water snake. These snakes can be found in streams or ponds across most of the state except in northwestern and north-central Iowa. Northern water snakes are not venomous and eat fish, frogs, and salamanders. You should never handle a snake. They may perceive you as a threat and will bite to protect themselves.
Sources: The Snakes of Iowa by J.L. Christiansen and R.M. Bailey (published by Iowa Department of Natural Resources); Snakes of Missouri by Tom R. Johnson (published by Missouri Department of Conservation)