In the past a conference I've been involved with had a problem with one presenter calling another presenter a gendered slur on Twitter preceding the conference. At the time we had no code of conduct at all, but we were thinking of adopting the one based on either Drupalcon's. But I am not sure that "We do not tolerate harassment of conference participants in any form" is broad enough. We would like to make it clear that participants are expected to not harass other participants even outside the conference. Or is that overstepping things? Should we limit it to communications regarding the conference (the Tweets were related to the conference). We really do not want to include presenters who are hostile in this way.
At the end of the day, promoting ethical conduct is not going to have a 100% success rate. We can all wish that people would act with decency, but in the immortal words of Tom Lehrer:
There are people in this world who do not love their fellow human beings, and I hate people like that.
As you mention, you can set a code of conduct. In fact, you can use Drupal's almost word-for-word as it's licensed under Creative Commons. And that's a good first step. But at the end of the day it is unenforceable unless you also add some teeth you any agreement with any conference participant.
Cover Yourself Legally
For any sort of contract you sign with any presenter, anyone who rents a booth, or otherwise is involved in the conference, you can add language to the agreement stating (in appropriate legal language for the location) saying:
The conference organizers reserve the right to refuse participation for any reason at any time.
If you have any indication that someone is being abusive or harassing participants, point to the clause and kindly (or unkindly) uninvite them.
Give Speakers the Low-Down Beforehand
Even if you have a code of conduct, and you have wording like the above protecting yourself, that doesn't really help if someone doesn't realize and oversteps what you consider the bounds of decency.
Especially for the speakers, who you are likely paying money to for their attendance, it is probably a good idea to be straight with them beforehand to let them know what is expected of them.
This can be a simple one-page non-legalese document that has no legal clout whatsoever but makes it clear what the guidelines are (or things they should absolutely not do).
Realize That This May Impact Business
Even if you take all the precautions possible, this won't prevent someone from doing something stupid. You will need to prepare yourself and your organization for what to do if something goes wrong.
Payment to Participants
Some participants will come to see a specific speaker. If that speaker gets cancelled immediately before the event, after they have already booked airfare and accommodations, what will be your policy?
Payment to Speakers
Likely you are paying a lot of these speakers to attend. Will you still pay them? Will you try to negotiate a contract that refuses payment? Are you willing to withhold payment from them with knowledge that they may take you to court and make this very public?
If a speaker gets cancelled at the last second, how will you announce it to the participants? Will you be honest and up-front to participants (shifting blame to the speaker), or will you cover it up (taking blame on the conference organizers)?
My Personal Belief
At the end of the day, no contract or code of conduct will save you (though it may help "set a tone" which makes people more aware of their behavior). The best thing to do is to give yourself the ability to make any decision (including preventing them from speaking), and prepare your organization internally for what to do if this comes up. It could have a large impact on your business, and that is not something you want to discuss two days before people show up.
Depending on the size of your industry and the prestige your conference has, the answer for how to handle it will be different for each organization. Find out what is best for yours.
I think that a code of conduct is a fine thing for a conference to have, and Drupalcon's is a fine place to start.
The code of conduct should be communicated clearly to both conference presenters and conference attendees, as well as the potential consequences of breaches of the code of conduct. Examples of conduct that are against your code should be included. Your tweet example is an excellent one to illustrate the point that behavior that happens outside of the conference itself can still fall under the purview of the code of conduct, and thus have repercussions at the conference (or future events, if it's after the conference). Presenters are ultimately representatives of your conference (after all, you've either invited them to speak, or selected their submission to present), and a presenter who slams another presenter reflects poorly on your conference. (It also reflects poorly on the presenter who somehow thought that it was appropriate to slam another presenter, but that's outside the scope of this conversation.)
I think that a code of conduct is likely to be something that evolves over time. If you find a case that is wrong but isn't covered by your code of conduct, then you'll need to change your code of conduct to prevent such things. I also think that the existence of the code of conduct, and clear and direct communications about the code of conduct, helps set expectations about behavior that isn't acceptable and helps create an environment where that behavior is less likely to occur.