Later today, NASA's twin GRAIL spacecraft will crash into the far side of the Moon, ending their successful mission mapping lunar gravity. Fear not, however, this crash is planned. The spacecraft are extremely low on fuel, and NASA prefers a controlled crash to one that might accidentally hit an Apollo landing site or other historical lander.
These aren't the first space missions to end in a crash landing. For some spacecraft, the crash is the whole mission. In 2005, the Deep Impact mission slammed into the comet Tempei, causing a plume of material to be ejected, which was subsequently studied by another spacecraft. Similar events took place on the Moon in 2008, when the Indian-developed Moon Impact Probe crashed into the lunar surface. The result: detection of water on the Moon.
Other spacecraft are crashed to protect the extraterrestrial friends we don't yet know we have. Despite a rigorous sterilization program, anything launched from the Earth likely carries terrestrial bacteria and other organic matter. This bacteria could prove to be the ultimate invasive species - if it landed on a body such as Europa or Titan, it could forever cloud our search for life on these moons. To this end the Galileo spacecraft, which studied Jupiter from 1995 to 2003, was flown into Jupiter to protect Europa. The same is planned for the Saturn-orbiting Cassini spacecraft when its mission concludes in 2017. Both Titan and Enceladus are thought to be possible homes for life in the solar system and an uncontrolled Cassini could accidentally hit either. The same year, the (still en route) Juno mission to Jupiter will be de-orbited the same way.
This big exception to this? Mars. Martian landers such as Opportunity and Curiosity are stuck forever on the surface, along with any Earth-based stowaways they may carry.