The case
Syndication made the original Star Trek a daily after-school ritual for Gen X, and "Beam me up, Scotty" became the show's catchphrase. It's on bumper stickers and T-shirts. It's not in any episode.
Kirk says nearly everything else: "Beam us up," "Scotty, beam me up," "Two to beam up." The version everybody quotes was assembled from those pieces by fans, and it's now more famous than any line the show actually wrote.
Why our brains do this
Catchphrases get standardized by the audience. The tidiest form of a line replaces all the messy real ones.
Sources: Wikipedia — Beam me up, Scotty · Wikipedia — False memory: the Mandela effect