What does Wilson see in Mrs Pike? She's quite ghastly on every level!
That we see. If I recall correctly, most of her screen time is when the rest of the platoon are around, and I don't think she'd be the sort of person to like that both her lover and son were in the Home Guard. So probably when we see her her dander's up and she's being hysterical. At home she could be a lovely woman. Or, maybe Wilson is a bit of a masochist.
I've always assumed that ~18 years prior Wilson was just playing around, seeing what he could catch. Had an affair with a (most probably then married) Mrs. Pike on a whim. After the birth of his son Frank (verified as his son by the great Croft himself in an interview) and Mr. Pike's probable death, he probably stayed with Mrs. Pike out of a sense of duty (remember the episode where his daughter from a previous marriage came to visit and he said he got her into a good school). Wilson does feel duty to the children he has had even though he's been a bit of a player.
Or, looked at another way, it's no more a headscratcher than any other sitcom relationship. Relationships - at least amongst adults and not young starry-eyes lovers - generally get portrayed as fairly joyless affairs on British TV of this era. Middle-aged wmen are generally the henpecking ball-and-chain there to make the men look all the more funnily ineffectual by emasculating and belittling them with their dominance. So it's not that Wilson has masochistically chosen to have an affair with a tyrant, but that this is just what women are like in that world.