My daughter went through that, too. Unfortunately, she learned quickly how to go over the baby gate.
She likes to sleep with the door open a few inches. What kept her in bed was explaining that if she wants the door to stay open, she has to stay in bed. If she got out of bed or kept me running up and down the hall because she kept calling me, I'd close the door. When that happens, I would stay at her door holding the knob, never locking it, for about 30 seconds. Then I'd open it and tell her that the choice was hers whether she wants to keep the door open or closed. If she got up again I'd repeat the process, but hold the door shut for 1 minute, extending the time every time she got out of bed. It only took a few times and she learned to stay in bed. She's now four and has done a fantastic job of staying in her bed for a few years now, but occasionally I have to ask her if she wants me to close the door. It works every time.
This came from Dr. Ferber's book "Solve Your Child's Sleep Problems," which I'd highly recommend that any mommy read.