Drains remove overflowing water from the floors and grounds of your prison. They are a necessity for a clean and hygienic prison.
Water which is allowed to overflow, without drainage, may damage objects and cause them to malfunction, particularly electrical objects.
Perhaps less importantly, excess water will cause plant life on your outdoor grounds to overgrow. Weeds and wild flowers will appear, causing your outdoors to appear untidy.
Drains should be placed in areas which cut off the flow of water to the rest of your prison (e.g. showers). Placing a drain at the entrance and/or exit of a shower room will prevent the water from flowing outside of the said shower room and thereby causing a flood.
Drains should also be placed under the doors of cells. When a prisoner becomes disgruntled, there is a high probability that they will attempt to destroy their cell toilet, which will result in flooding.
It is also wise to install drains beneath the doors to utilities, namely, Power Stations. If water manages to contact a Power Station, perhaps if a water pipe bursts (if Events are enabled), the end result may be an explosion, with the possibility of the deaths of any nearby entities.