Apparently, it depends on whether the word itself has a 'consonant sound' or a 'vowel sound'. Although 'ubiquitous', starts with a vowel it is pronounced 'you-biquitous', which has a consonant sound. Hence, 'a you-biquitous' sounds correct, whereas 'an you-biquitous' does not.
I confess to being fascinated by the rules of grammar, punctuation and spelling. I don't always get it right but I feel great when I do, because, unlike playing sports or working out numbers, it is one of the few things that I have ever been any good at. I fully accept and respect that other people can't see the point of apostrophes etc but, for me, getting it right makes me feel good... 😊
P.S I have now left myself wide open to my grammar being corrected!