Serena told him.
Then Fred asked June "Is it mine?" June said "Of course" and he replied along the lines of "You lie so well."
So he knew ages ago, he's been choosing to ignore it because he needs a baby as much as Serena wants one.
That young Commander getting the promotion just because he got his own wife pregnant proves it. Having a baby in the house gets you further. Fred doesn't care if it's his baby or not, it will still serve it's purpose of furthering Fred's career.
And I hate to say it but if that baby is a girl, when she reaches Eden's age Fred might actually be pleased she's not his as he might be interested in her in another way by then. He is that creepy.
But if its a boy, then perhaps better for his career because men are more valued.
I really don't think he set them up. Serena would be angry, he would be embarrassed yet again.
Bad enough June was 'kidnapped' and missing for three months. Bad enough that his Rachel and Leah Centre was bombed. Bad enough the trip to Canada ended so embarrassingly. Bad enough that June's false labour embarrassed both him and Serena when their guests had to be sent away with a cancelled party and no baby. He absolutely can't have another missing Handmaid, dead or missing chauffeur, traitors under his roof, and no baby.
His first Handmaid killed herself, there's only so much embarrassment and disobedience he can survive as a Commander. He could just as easily have made up something about Nick and had him arrested at home if he knew and was jealous about the baby.