I've been playing a lot of Kerbal Space Program lately. I've launched quite a few "half-failed" missions where my craft will get to where it's going, or very close to it, only for me to realize that it doesn't have enough power to get back. Most of these missions are now roughly analogous to the real-world problem of dysfunctional or retired satellites which remain in orbit as space junk.
However, I've found that the majority of my space junk problem (not really a problem just yet, but I'm sure it will be eventually) isn't with these missions. Most of my space junk is from spent rocket stages that were ejected, and now remain, in orbit or on exit trajectories from Kerbin (the Earth analogue in KSP).
Here's a shot of Kerbin, looking at the south pole, which shows many of the 65 trackable items currently categorized as "debris". All of these are upper stages that were discarded from previous missions - actual flyable (albeit perhaps un-fueled) spacecraft and probes are categorized separately.
In considering how I'd clean up this mess, now that I've obtained the "Advanced Grabbing Unit" (effectively a big claw I can put on a spacecraft to grab stuff, e.g. so I can bring stuff down from orbit or re-direct it when it lacks its own power) I realized that any missions I'd launch to clean up this junk would probably just end up creating more in the process. After all, I'd need a lot of fuel and power to get back up there in the first place, and to get around once I am, and eventually I'd end up wanting to drop off empty components in orbit again. This got me to thinking a little less about cleanup, and more about prevention.
So, I'm wondering if this is a significant consideration in the design of real-world spacecraft. Do real-world space agencies and commercial providers make any special efforts, when designing their rockets, to make sure that most expendable stages (not just reusable ones, like the Space Shuttle SRBs) are returned to Earth instead of being left in orbit? Is any consideration given at all to stages which would be discarded on an exit trajectory from Earth? (e.g.: Try to get them captured by the sun or another Sol-based celestial object, instead of leaving them to fly out where they might eventually impact some distant civilization.) Are there any common design methods or technologies that are specifically intended to address this issue?