People may have temporary lapses from the sleeping pills. They may have motor and coordination (problems). Sometimes, elderly patients may fall at night.
Writing out a prescription is a quick, temporary fix. It's a lot easier to write a prescription than sit down and try to figure out what the potential reasons that could be contributing to the lack of sleep.