If you are honest with yourself, you probably have been in situations where you have been too friendly with someone of the opposite sex. It could be a co-worker, neighbor, someone in your social circle, a family member, or maybe someone at church. Someone pays attention to you and you like it. Perhaps you are in a vulnerable period of your life when things aren't going too well at home. You are made to feel like you matter, that you are special, a somebody. Without even realizing what you are doing, you respond in a flirtatious way.
When this begins to happen, you must take responsibility for your behavior and understand that if you don't put the brakes on and stop it, you will likely fall into moral failure. We are wired for specialness. We want to be treated with interest. We want someone to want us. We like the feeling that comes with being paid attention too. It is normal.
The best way to keep the fires burning at home is to make your spouse your best friend. Light banner and playfulness at home will go a long ways towards keeping your marriage fresh and fun so you won't fall prey to the temptations out of it.