Now that I think of it, I haven't heard that expression in a while - or the shorter version, "pew," or "pewie" (Pyoo-eee), which I heard a lot as a kid. I don't think I've heard "pewie" since the 80s.
As near as anyone can tell, "P.U." doesn't actually stand for anything, it's just a drawn-out version of "pew," stretching it out to "peeyoo." Some say it should properly be spelled "piu." Others say that the practice of drawing it out until it sounds like an acronym was popularized by Bugs Bunny.
Using "pew" as an injunction certainly goes back a long way, though - it, along with "phew," was the subject of a lengthy entry in an 1870s dictionary of etymology that suggests it may have originated with any of a number of ancient language, which have similar words with similar meanings (such as the Latin "phu," which was a term to express the notion that something smelled bad, the Sanskrit "pu," meaning "stink," etc - note the root word of the term "putrid."
Now, what I don't think we really know is whether there's an actual connection - that we say "pew" when something smells bad because the ancient Romans did. It's also possible, given that similar words show up in so many different ancient languages, that it's more of an instinctual thing. Linguists really do argue about this.
Also of interest - "fi" was another exclamation that meant a bad smell was present. As in "fee, fi, fo fum, I smell the blood of an Englishman."
When I was about 7, deep in my obsession with the phrase, I wrote a whole book about it, reprinted below. I'm sure the goodreads community would dismiss it as "a laundry list of stuff that smells bad (and an incomplete one)."
|(note: Eli is my little brother)|