From what I have read, many sleep aids (and alcohol) interfere with slow wave sleep and REM sleep. Even though they make you sleep, your brain is not getting a chance to do all the stuff it is supposed to be doing while you are asleep.
One of the best things for me about being sober (I just passed my 3 month point) is the quality of sleep I am getting. I love it.
I did not sleep well my first month or so, however. So if you are newly sober it takes a little time for your brain to relax enough to sleep well.