In life we are often caught between two impossible choices. Taking, what we consider to be, the lesser sin is still sin. Just relax and follow Martin Luther's advice. "Be a sinner and sin boldly, but believe and rejoice in Christ even more boldly."
It is better to regret the sin, than to try and rationalize why you had to sin. It has nothing to do with God understanding why he had to sin. It is all about God forgiving our sin. No matter the sin, or why you had to do the sin, forgiveness is still needed.
That's the worst advice I've ever heard--and it's totally anti-scriptural.