As long as one has a body, one cannot renounce action altogether. True renunciation is giving up all desire for personal reward. Those who are attached to personal reward will reap the consequences of their actions: some pleasant, some unpleasant, some mixed. But those who renounce every desire for personal reward go beyond the reach of karma.
(Lord Krishna, Bhagavad Gita)
You see your attractive neighbor and know how much sexual desire you have, but you decide not to do anything about it since both of you are married and you respect this holy institution. This might be the right choice, or it might not be. Only you know what is right for you, and you have to make decisions like these every day. By making them and by experiencing how your world reacts to you; these decisions in fact define you.
If you try to repress your desires by saying "I must not look at my attractive neighbor", or "I only must have holy thoughts", your repressed desires will come back to you in one way or another. Everything is energy, our thoughts and feelings, our desires and actions, as well as all of our interactions with life. But not all is lost, life is here to rebalance the energy for us. So when we repress desires that we don't deem to consider helpful, they don't have to come back as ghosts that are out to get us on a full-moon night. Along a spiritual path we are very much encouraged to transmute energy into something entirely different and creative. Every creation is a re-channeling of energy in one way or another. A spiritual path is here to help us with life's complex choices, and if we manage to stay on it for a while, will help us to express our SELF.
Many religions describe the God experience as a perfect stillness, and absence of desires in all forms: "Be still, and know that I Am God", as the Bible sums it up so well. The question, however, is how exactly do we reach this state. The is the road of the Buddha, meditation and mindfulness, the Tao of Lao-Tzu, contemplation and observation, the teachings of the Christ, self-less love and insight, and the message of Lord Krishna, self-less work and a spiritual life mission. My additional piece of advice, If you aren't quite ready in all areas of your life for the teachings of our Giants, don't hesitate to dive into life to the best of your ability - and without destroying too much spiritual China in the process - let life lead you back to your spiritual path. Desires do burn off as we get what we aspire. "Been there, done that", is a holy mantra; you are ready for a fresh start afterwards.
With all our best intentions to be a seasoned spiritual traveler, we should be humble before life's complexities as well as before our soul demands. The Bhagavad Gita describes many ways how we might transcend our desires with the intention to reach God. Yet, Arjun looks like a little child next to Lord Krishna with all his whining and confusing questions and endless repetition of concerns. What you probably don't know about him is that he happened to be the "best of the best" in his days. He competed once with India's best archers and he won it with a perfect track record. When his teacher asked him to share his secret, he said "When I aim for the bird on the tree, I aim directly for the eye and I do not shoot before I have perfectly zoomed into my target." So if he needs a little time to figure out his mission in the battlefield called life, who are we to ask for a shortcut to the Way.
Do not beat yourself up over your experienced faux-pas. Whatever happened, happened, and probably happened for a good reason. Here and now, however, you may have to question some of your desires just because they may hold you back on your spiritual path. And that pain unfortunately increases with every step you take. You may have to repress, transmute, express or transcend. Life is the best life coach there is. It helps you disentangle your desires and allows you to go after what is truly meaningful to you with laser-like focus. With every desire you have, there is a perfect opportunity to express yourself beautifully without being in conflict with who you truly are. Just participate in the dance of life and come Home.