Imagine a movie landscape where the bad guy was never allowed to get away with it, where all crimes had to be punished and all moral lapses had to be corrected by the time the credits rolled. Thanks to the Hays Code, from 1934 until the mid 50s, that was the rule in the American film industry. On top of that the studios often worried about sad or pessimistic films scaring away theater patrons, and sometimes went so far as to demand that darker endings be rewritten as happy ones. To this day, nervous executives can do a lot of damage to a good ending, now using poor test audience reactions as the common excuse to make cuts and edits. In short, not all happy endings are necessarily the best ones, and I've singled out some of the most egregious substitutions below, excluding those that the directors themselves were directly responsible for ("AI", "Source Code," etc). Spoilers, spoilers everywhere, so be careful.
"The Bad Seed" - When you think of evil children in cinema, Damien of "The Omen" gets a lot of press, but my money was always on sweet little Rhoda from "The Bad Seed." The novel and play the film was based on both ended with the murderous little girl killing her mother and getting away with it. However, under the Hays Code, crime was never allowed to pay, so Rhoda was struck by lightning in the final reel, and her mother miraculously revived. I can't be too unhappy with this one, because even though it would have been far more sinister fun to have the original ending for the film, some part of me cheers every time that pigtailed little monster gets it.
"And Then There Were None" - Agatha Christie's mystery novel, also known as "Ten Little Indians," or by its less savory original title that I'm not going to print here, killed off ten characters on a remote island one at a time, leaving a perfect closed-room mystery for those who would later find them: which one killed the others and why? The film's lighter ending leaves two survivors and the murderer's plans to commit a perfect crime are foiled. It's not a bad ending, but it's not nearly as psychologically interesting as the original. Nearly all later adaptations followed the film's example, and even Agatha Christie herself wrote a stage adaptation where the leads survive.
"Infernal Affairs" - The Hong Kong thriller that "The Departed" was based on ends with the gangsters' mole, played by Andy Lau, getting away with his policeman cover intact and resolving to use his position to become a real good guy. For mainland China, whose censors still seem to be stuck in the 50s, an alternate ending was created where Lau's character confesses his crimes and gives himself up to the police. In light of that, I wonder how they explained the sequel which features Lau still undercover as a cop - though that one does feature a final fate for the character that the censors would certainly approve of.
"Brazil" - One of the most famous battles ever waged between a filmmaker and a studio executive occurred in 1985, when Terry Gilliam went to war with Universal's Sid Sheinberg over getting "Brazil" released with its gut-puncher "1984" inspired ending intact. Sheinberg insisted on the creation of an alternate version referred to as the "Love Conquers All" cut, which pretty well sums up the problem right there. Gilliam had to make edits, but his version was the one that made it to theaters. Sheinberg's was aired on television a few times, but today mostly exists as a curiosity item on collectors' discs. Thank goodness.
"First Blood" - The movie originally ended with John Rambo committing suicide, just as he did in the David Morrell novel. It was depressing, sure, but it was perfectly appropriate for the story of a Vietnam veteran who was driven to wage a guerrilla war against some small-town cops as a result of his battle traumas. Similar films like "Falling Down" made it work cinematically, so I don't see why "Rambo" couldn't have. And frankly, the character going out by his own hand would have been a far more dignified end than getting transmogrified into the ridiculous supersoldier action-hero that Rambo became in the sequels.
"Little Shop of Horrors" - Possibly the most notorious scrapped ending of all time belongs to "Little Shop," which would have seen the sentient alien plant Audrey II swallow the main characters whole and then go off to conquer the planet. Over twenty minutes of film, whole song numbers, and a massive special effects sequence were cut, all to change the comedically dark and apocalyptic finale into a typical happy ending. Part of what makes this ending so famous is how inaccessible it has been to curious fans. In 1998, Warner brothers actually recalled DVDs of the film that included the ending as a special feature, because of squabbles over the rights to the deleted material.
"I Am Legend" - This one isn't the substitution of a happy ending per se, but it's certainly a more Hollywood one. Will Smith's character is supposed to have the epiphany that his experiments on the infected humans has made him into a monster figure to them, thus explaining the title "I Am Legend." It turns out the mindless creatures he's been fighting with for the whole film aren't so mindless after all. He subsequently abandons his work and leaves Manhattan. In the theatrical version, no enlightenment is to be had. Smith blows himself and his lab up with a grenade to ensure the escape of some other survivors, ending the film with a bang and some generic platitudes.
"Invasion of the Body Snatchers" - This should have been one of the most deliciously pulpy, campy horror movie endings of all time. The hero, having witnessed the invading pod people conquer his town, runs out into the local highway, screaming warnings to passing cars, "Can't you see?! They're after you! They're after all of us! Our wives, our children, everyone! They're here already! You're next!" And then he looks straight into the camera, wild-eyed. "You're next!" The studio took one look and made the filmmakers go back and shoot wraparound scenes so the whole film is told in flashback, and the movie ends with the authorities being alerted to go save the day. What utter spoilsports.