Response to topic change:
If the problem is simply that people aren't trying hard enough you need to come up with a way to get them interested. This could range from being more open to ideas, even if they suck, to promising a bottle of Scotch if the project makes it in on time.
Don't buy it off the bottom shelf!
Response to "incompetence":
Yeah, I've run into that situation. Total incompetence is not something I have to deal with but more than a few times I've been surprised at someone I thought had figured it out doing something I see as rather...questionable.
First thing you have to do is try really hard to suppress that feeling. I'm sure you've done stupid shit too. I know I have.
Next thing you have to do is make sure you explain why something they've done was wrong. Let them argue with you and/or ask questions...hopefully they do. Make them do it right; hopefully you get support from management because that's always been one of my major problems (they have to support you when you say, "Go do it right," and the other guy starts freaking out)
You have to do this as politically correct as you possibly can. Even if you want to scream at them, "WTF where you thinking you MORON!!!" That doesn't fly and won't help at all. So don't try talking to them at first if you feel that way. Sometimes email works better so you can edit yourself.
The object here is to help them improve. It's frustrating as hell trying to get something accomplished with people who, from your perspective, can't code their way out of a paper sack....but sometimes you have to.
That's how you help THEM improve. Now to you...
You have to learn how to let it go. Code doesn't have to be perfect...it just has to work. You might have to lower your standards a bit.
To accomplish this and not let the product's code tree turn into a terrible mess you have to focus on the big issues. So long as the sandbox is limited to a specific area that can be redone later, when there's time or they've learned more, it can be the worse, nastiest spaghetti code you've ever seen and so long as it works...ok. So look for ways to make that possible. If your architecture is uncoupled you can let incompetent people work on it without too much damage.
Of course, this means that whenever you have to fix something they've done, or add a feature to something they wrote, you're going to get a headache. That's life. Live with it. If you can, you can force them to add the feature or fix the bug...which actually can go a long way toward teaching better practices and coding skills (the more you have to clean up your own crap, the less you tend to crap on the carpet).