The Bible does not forbid close friendships between men and women. As Christians, however, there are some principles that we would be wise to live our lives by. Married people especially need to be wary of friendships with members of the opposite sex because temptations are more likely to arise when there are marital issues. If a man's best friend is a woman who is not his wife, he is likely to share these problems with her, which can lead to an unhealthy emotional attachment.
I do not believe that most married men (or women) who have affairs purposely go out to find a romantic interest outside of their marriage. I've heard so many people say, "I didn't mean for it to happen, it just happened." These things "just happen" when we put ourselves in situations that are difficult to control. When a man has a wife who is not necessarily very attentive to his needs, he could easily feel that he has fallen in love with another woman who does give him this attention he craves.
Even a marriage that is built on a foundation of faith in Christ and has relatively few problems is not immune to extra-marital temptations. This is why the Bible does not tell us to stick around and try to fight temptation, but to find the way out of it that God will provide (1 Corinthians 10:13). Trying to fight temptation seems to become especially difficult when it comes to matters of the heart or the lusts of the flesh. 1 Corinthians 6:18 tells us that we need to run away from sexual sin, because it is much easier to run away from temptation than to stay and fight it.
A man or woman who is married should carefully avoid putting themselves in compromising situations when it comes to the opposite sex. If they are seen together in public, it will give the wrong impression. If they are alone on the phone or in person, they will subject themselves to the temptation of an emotional or physical affair. The Bible tells us that everything we do should be for the glory of God (1 Corinthians 10:31), so I would stick to visiting as couples or "double dating" with other married couples, as opposed to risking the complications associated with close friendships of the opposite sex.