Novelists who have moonlighted by writing screenplays in Hollywood read like a Who's Who of American Literature in the 20th century. They include the likes of William Faulkner, Truman Capote, Carson McCullers, James Michener, Norman Mailer, John Steinbeck, James Jones, Vladimir Nabokov, Larry McMurtry and lots of others. Some of them, like Joseph Heller, used pseudonyms in hopes their work on films would not detract from their more serious literary efforts.
The main reason writers have gone Hollywood, other than the glamour of meeting movie stars, is the money. Serious novels may win praise and occasionally prizes, but they don't usually make much money. Writing a few screenplays, for which they were paid whether their screenplays were ever turned into movies or not, helped feed their families while they worked on their next books.
Most writers don't lead particularly exciting lives. Mostly they just write. Hemingway, however, though he took his writing seriously, also devoted much of his life to hunting big game, fishing in the ocean and going to bullfights. He was also involved, at least on the sidelines, in more than one war. He had a lot to write about, and magazines were eager to print anything Hemingway wrote about his life. His books, whether fiction or nonfiction, also tended to be about his own life.
In the early 1930s, when Hemingway was at the top of the literary world, Esquire magazine was just getting started and trying to make a name for itself. A Hemingway article appeared in the very first issue. The editor, realizing how much clout Hemingway had, later said he promised to pay the writer double what the magazine paid anyone else for articles of the same number of words. This may have been an exaggeration, but nevertheless those frequent Esquire checks helped Hemingway buy his fishing boat, finance his hunting trips to Africa and, in general, live the good life without ever having to set foot in Hollywood.