It's deeply, deeply unlikely to happen in the kinds of hotels most Westerners will be staying in - it's not in the interests of the Dubai authorities to hit the lucrative tourist trade. Much more likely to happen in the seedy budget places used by prostitutes as part of a fairly halfhearted brothel crackdown, but in fact fairly unlikely to happen in hotels at all, or in Dubai at all (unless you are an unmarried couple reported to the police because you are noisy neighbours or because one or both of you is reported by a spouse not impressed with adultery - there were occasional newspaper stories of wives walking in on husbands and their girlfriends and calling the police on them).
The vast majority of the opposite sex sharing space fines when I was there took place in the poorer areas of Sharjah and involved Indian/Pakistani and African people working in low-level retail/service jobs.
The problem again is the 'grey area. Sharia law prohibits unmarried unrelated men and women from sharing closed spaces (which technically includes taxis, lifts, offices etc) but this isn't applied in Dubai as it is in Saudi, or used to be. There were a few 'Arabic' hotels which had male-only and female-only floors, though.
But if you're pregnant, unmarried and give birth early or need emergency medical care while in Dubai, then, yes, you are playing Russian roulette with whether the clinic/hospital asks for a marriage cert or notifies the authorities.