There's an algorithm doctors are supposed to follow in treating a sleep disorder. That includes sleep hygiene and non-medication interventions first. Unfortunately, I've seen too many doctors too willing to medicate too easily because it gets the patient in and out of the door faster.
I've only given sleep medications without the non-medication interventions in very extreme cases that are usually reserved for inpatient cases. E.g. the person is clearly manic and has not slept in days. In those cases, when the person's mania clears, I wean them off the sleep medication.
I have noticed that many of the medications prescribed for sleep conditions are dependence forming in themselves a do not treat the actual cause of the problem.
True. Many of the sleep medications are benzodiazepines, that are potentially addictive, habit-forming, and can cause a person to be physiologically dependent on them. Others can cause sleep tolerance, a condition where the efficacy of the medication becomes less and less over time and eventually it'll stop working.
Sleep medication could also make an existing problem worse. E.g. in obstructive sleep apnea, someone with a sleep problem is waking up in the middle of sleep because the airways are obstructed. The real needed treatment there is a CPAP device. Sleep medication could delay the waking response from someone not breathing, in addition to causing a delay in the real solution to the problem--a CPAP device and often times the patient needing to lose weight.
In long term studies, no medication intervention and use of non-medication therapies were the most effective treatment for most people, but like I said, I've seen too many doctors wanting to rake in the cash and get the person in and out of the door, and too many patients wanting a quick fix instead of addressing the problem for real.