First, a little bit of background. Ragtime as a music came up in the late 19th century. It's derived from the sound of marches, jigs, and other bits of light music played with a "ragged" (ie syncopated) rhythm. It enjoyed a heyday in the early 20th century before ceding the spotlight to one of its descendants, jazz. In fact, pioneering jazz players like Jelly Roll Morton and Buddy Bolden started out their careers as ragtime players. Some of Scott Joplin's tunes, most notably the "Maple Leaf Rag," enjoyed new life as jazz standards.
Now, your question. The fact that our minds go "Joplin=ragtime, ragtime=Joplin" is due to three main and interrelated factors. One is that Joplin was remarkably prominent in his time. His "Maple Leaf Rag" sold thousands of copies at a time when sheet music, rather than records, was the medium. One ad even claimed sales over a million; this is likely an exaggeration, but suffice it to say that the "Maple Leaf Rag" was extremely popular in its day. Other Joplin rags were also highly successful, making him one of the most well-known composers of ragtime music of his day. Had his music never seen much interest after his death, he still would have been recognized as one of the giants of the genre, or as he was billed in his day, as the "King of Ragtime."
Another is that Joplin melded classical music ideas into his ragtime compositions. He also composed classical music with ragtime influences, walking the line between the two genres quite nicely. This is important, because for the most part ragtime was a popular music, and popular musics are much more transitory. What popular today isn't tomorrow, and much of the music may end up forgotten within a few decades. With classical music, 100 years is a relative blink of an eye. Joplin's one surviving opera Treemonisha, for example, has been put on many times since it was first revived in the 1970s, sharing stages with plenty of operas from the 17th, 18th, and 19th centuries.
So, Joplin was both A) very popular and B) had crossover appeal to a genre where old music is A-OK. But that revival in the 1970s had a force multiplier that is probably the biggest reason why Joplin's name and music survives in popular imagination today: The Sting.
A caper film featuring Robert Redford and Paul Newman at the height of their movie stardom, it came 4 years after the two had starred in Butch Cassidy and the Sundance Kid, the highest-grossing movie of 1969 with over $100m at the box office. The Sting was likewise a massive success, winning 7 Oscars including Best Picture, Best Director, and (crucially for our purposes) Best Score. It was also the 2nd highest-grossing movie of 1973 behind The Exorcist.
The movie was set in 1936, and director George Roy Hill (who had also directed Butch Cassidy) went for an old-timey vibe. The lighting, shooting techniques, title cards, and many other aspects of the film were deliberately done to set the tone of a 1930s gangster movie. For the score, Hill asked composer Marvin Hamlisch to arrange some of Joplin's ragtime music. It's worth noting that Joplin was 19 years dead by 1936, and the music of the day was jazz and swing, not ragtime. Joplin was chosen for old-timey effect rather than historical accuracy.
In fact, Joplin was in many ways more relevant to the 1970s than the 1930s. Remember that crossover appeal I mentioned earlier? Well, in 1970 pianist Joshua Rifkin released an album of "Piano Rags by Scott Joplin," the first major recordings of Joplins music since his heyday. You might think of ragtime as being fast, bouncy, and loose, the kind of music played on a jangly upright piano in the smoky backroom of a bordello. Joplin, however, saw his rags as piano music akin to Chopin or Liszt, and Rifkin treated them that way. Slowing the music down to the original tempi favored by Joplin accentuated the rhythmic and harmonic complexity that the composer had built into his work.
This album helped show ragtime in a more serious light, and other musicians and music lovers took interest. Joplin's music was pored over by scholars, and a seminal two-volume set of his sheet music was put together and published by Vera Brodsky Lawrence and the New York Public Library. New England Conservatory, a leading music school, started a "Ragtime Ensemble," dedicated to Joplin and other composers of his ilk. Rifkin's approach to Joplin as a classical composer whose works should be taken seriously rather than dismissed as "popular music" began to take hold among the classical community writ large.
One music lover who took interest was George Roy Hill, who heard Rifkin's renditions and thought they were perfectly suited to a breezy yet refined movie that needed a score that sounded like "yesteryear." He convinced Hamlisch (who was much more inclined toward original music) to arrange some of Joplin's work for the score, introducing "The Maple Leaf Rag," "The Easy Winners," and the iconic "Entertainer" to a much wider audience. Rifkin's album sales went through the roof, and the soundtrack album to The Sting hit #1 on the Billboard charts. Hamlisch won Best Score at the Oscars, productions of Treemonisha ramped up, and Joplin was given a posthumous Pulitzer Prize in 1976 for his contributions to American music.
So, it was really a perfect storm. Joplin did set himself apart from his peers with his interest in classical music, and that crossover appeal helped his music get into the hands and ears of classical audiences decades after ragtime had ceased to be popular. Then, his music was featured in one of the biggest movies of the 1970s, cementing his legacy as an iconic composer of a distinctly American musical style.