Dear M.,
The more we try to keep the human spirit in a box, the more determined that spirit becomes to break free.
If you want the answer to how to handle your daughter you must first think about how you would like to be treated. Children are as deserving of respect as adults. Would you treat an adult friend the way you have been treating your daughter? Or would you perhaps talk to them and support them?
Your daughter is at a delicate age. She has experienced a lot of change in her life recently and this has occurred simultaneously with the beginning of puberty.
I sense that her forays into "sex and drugs" are probably part of trying to fit in with a new group of children. Acceptance by one's peers is the main driving force behind the acts and behavior of most teenagers.
There is also the fact that children will find a way to do whatever they want to do with or without a parent's permission. The only way to stop this is to lock them up 24/7. Hardly feasible.
Your fears my dear are forcing your daughter into a corner and she is reacting as any human would.
Also your narrative focuses a lot on your ex-husband. Your resentment towards him is clear as is your need to control both him and others. I have to ask if you made some decisions in your life that you regret. If so, did you feel that someone should have stopped you? Are you trying to be the STOP button for your children? Are you trying to make it so that they will not make the same "mistakes" you did?
Even if you could do this, you would be doing them a disservice.
What your daughter needs most now is your unconditional love and support. If she does not get it at home, she will seek it elsewhere including in the arms of a teenage boy.
Ask yourself "What would love do now?" as each situation arises.
I would also suggest some release work around forgiving your ex and allowing him to be who he is. As you have noted you can not control what goes on when your daughter is with him. By restricting her so much at your house, you only make it easier for her to rebel. You see, your restrictions make her feel justified to "fight back.".
I suggest you learn to talk to her and most importantly to LISTEN to her. I would like to recommend a book by Elaine Mazlisch and Adele Faber called "How to talk so kids can listen, and how to listen so kids can talk." It is easy reading and absolutely wonderful. You will find many gems in it.
In a nutshell, understand that control over others is an illusion. Instead learn to be a guide. All we can ever do for our children is set the example and share our wisdom. The rest is truly up to them and who they are being. We can not live their lives for them.
Love to you.
Z
EDIT: After reading the other responses I can only say that if punishment worked, we would have no problem children. They all misbehave, generally get punished and then turn around and misbehave again. Punishment is not effective. Further I would ask if it is even desirable. Haven't human beings evolved a little further than pain and fear as methods for "raising" our children? Haim Ginott, a famous educator, once said "Punishment does not deter misbehavior, it only makes the perpetrator more careful about misbehaving." (I paraphrase.) The main effects of punishment are to create traumatizations, rebellion, and determination to fight back. Don't fool yourselves ever into believing that you can ever know where your children are and what they doing 24/7 unless you are by their side. My best friend in school was allowed out two nights a week only. The rest of the time she lived on a farm in the middle of nowhere. She was our wildest friend.
EDIT 2: This just in from Daily OM:
March 25, 2008
Accepting Yourself
A Dynamic Choice-Maker
There is no such thing as a good person or a bad person. There are choices and actions that lead us in different directions, and it is through those choices and actions that we create our realities. Sometimes we choose or do something that takes us in the opposite direction of the reality we want to create for ourselves. When we do this, we feel bad—uneasy, unhappy, unsure. We might go so far as to label ourselves “bad” when a situation like this arises. Instead of labeling ourselves, though, we could simply acknowledge that we made a choice that lead us down a particular path, and then let it go, forgiving ourselves and preparing for our next opportunity to choose, and act, in ways that support our best intentions.
Many of us experienced childhoods in which the words good and bad were used as weapons to control us—you were good if you did what you were told and bad if you didn’t. This kind of discipline undermines a person’s ability to find their own moral center and to trust and be guided by their own inner self. If you were raised this way, you may find yourself feeling shockwaves of badness when you do something you were taught was wrong, even if now you don’t agree that it’s bad. Conversely, you may feel good when you do what you learned was right. Notice how this puts you in something of a straitjacket. An important part of our spiritual unfolding requires that we grow beyond what we learned and take responsibility for our own liberation in our own terms.
You are a human being with every right to be here, learning and exploring. To label yourself good or bad is to think too small. What you are is a decision-maker and every moment provides you the opportunity to move in the direction of your higher self or in the direction of stagnation or degradation. In the end, only you know the difference. If you find yourself going into self-judgment, try to stop yourself as soon as you can and come back to center. Know that you are not good or bad, you are simply you.