Why would reverse osmosis be preferred over distillation to supply drinking water to to a remote coastal town?
The major advantage reverse osmosis treatment has over distillation is that it can be cheaper; distillation uses a lot of energy to boil and separate water, while reverse osmosis, since it is in essence simple filtering, can be done with only human power or even dead-weight if the filter is set up vertically. Modern reverse osmosis filtration devices use far less energy than modern distillation, and can be run safely without human monitoring.
For removal of salt from ocean water, distillation is a perfectly acceptable solution, but the salt can cause corrosion and rust in the still's pipes and mechanisms. While the membrane of a reverse osmosis filter can get clogged and eventually need to be replaced, it usually purifies water faster than distillation.
Reverse osmosis also claims to filter more of the contaminants in salt or fresh water because the membrane pores are so small; distillation can kill and separate many contaminants, but it is possible that certain chemicals and molecules can attach to the gaseous water as it separates and condenses. Additionally, other chemicals with the same low-boiling point as water can become gaseous and merge with the distilled water, keeping it contaminated.