The heroic cowboy was a staple of popular American culture in the 1950s. As a child growing up in the 1970s, I was exposed to the tail end of the movement: I watched "Dallas" and "Bonanza" on TV, my grandparents listened to country music (Tom T. Hall), and watched hokey shows like "Hee Haw".
The comic books I found at my grandma's house advanced the cowboy image as well. Their publishers took cues from the popularity of TV and motion picture cowboys, whether living or dead. (Gene Autry, Roy Rogers, and Bill Elliot, to name a few.) The Gene Autry comic book series ran for 18 years (1941--1959) and 129 issues. The post WWII climate influenced the ideals that that the cowboy archetype stood for: law and order, peace and quiet, God and country (no separation of church and state), Mom and apple pie (Mom belongs in the kitchen, not in the workplace).
According to Owen Wister, he was a "Cowboy without any cows because the villians left him no time to pursue his career." --from The Virginian, 1902.