Washing rice before cooking it isn't mandatory at least if you're cooking the rice at home.
But it is indeed a good idea to wash the rice anyway before washing it to remove any surface starching, prevent any clumping of the rice and make the rice yield a nice fresh taste.
Washing rice also helps clean any bacteria that could be on the rice.
I find that when I cook rice that is cleaned beforehand it tastes much better than when I don't wash it.