How temptation is not sin, but the means of being good.
A certain elder said, God will not condemn us because evil thoughts enter our hearts, but only if we make a bad use of our evil thoughts. It happens sometimes that men's souls are shipwrecked through evil thoughts, but also it is by the entering in of such thoughts that we become worthy of being crowned.
Reference: http://www.archive.org/details/wisdomofdesert00birmrich