He got away with it because there was no law against fornication, in the same way there is in the NT. All of the Mosaic laws related to sexual conduct have to be considered in the context of women as property. It wasn't that the sexual act w/o marriage was problematic, it was that the man was tampering with another man's property. Judah having sex with a prostitute was not infringing on another man's rights. However, Tamar risked being burnt alive when found pregnant because she WAS someone's property--in that case, her father-in-law's property. She was one smart cookie to retain proof of paternity.
I wouldn't agree that the Bible is mainly fiction; however, it is certainly not the kind of accurate history that JWs like to believe. I think what we have are embroidered tales that have their root in some kind of actual events, though not in the fantastical form we read today.