Laws aren't enough to prevent things from happening. The fact that Denmark has equality laws doesn't mean that it's gender-equal, and it certainly doesn't mean that there's no sexual harassment. There are strong social mores against murder. There aren't strong social mores against sexual harassment. Having a code of conduct helps indicate to attendees that whatever their personal beliefs about sexual harassment are, and regardless of what local laws there may be about it, it won't be tolerated.