The custom of covering your mouth while yawning is common in several cultures, but so far, from searching secular sources, I have not found any such customs or requirements with Jewish origins. In Yawning: comparative study of knowledge and beliefs, popular and medical, O. Walusinski writes:

According to [Pierre] Saintyves, Islam sees yawning as a sign of Satan entering the body, and sneezing as a sign of his leaving the body. [...] "The Prophet told us that yawning is prompted by Satan and gave us the order to avoid it whenever possible. When it becomes inevitable, we must close our mouth with our hand."

Similar practices and ideas exist in India, and later in Europe during the Bubonic Plague where the practice was instead signing the cross in front of their mouth.

Your Rabbi (or the person he learned it from) likely picked up the idea from a source outside of Judaism such as the culture he grew up in. So far I haven't been able to find any reason in Jewish law why one should cover one's mouth, aside from, as you already mentioned, manners (which is a pretty good reason).