I think the two biggest reasons for second families is reputation and adoration.
For some men a pregnant mistress was (and in some places is) a huge deal. Their entire standing in the community would be destroyed if the mistress found out she was a mistress and made a stink. Akin to an adulterous religious leader being found out today.
I think for some men they have set up an “absence makes the heart grow fonder” world where they’ve somehow managed to compartmentalize two lives but even within those lives they have established boundaries where they are rarely expected to do much of the parenting or homecare. They show up, part time, and when they are home they are idolized because “Daddy’s Home”.