IMHO the primary reason is for the heck of it. It is the most exciting thing to say that you develop an OS. The second reason is that some OSes serve a particular niche like ROS
http://wiki.ros.org/ and they are obviously specialized to ease one form of development.