A quote from Rabbi Weiner: " However, a gentile may not keep them because it is a commandment from G-d, but rather because one is obligated to be a good, moral person.
Likewise, many prohibitions that are commanded upon the Jew are obligations for Gentiles to observe based on logic, such as the prohibitions against hating others, taking revenge or bearing a grudge. A Gentile should observe these prohibitions out of human decency, and not as Divine commandments of their own.
This duty is an absolute obligation upon Gentiles, and they are liable to be punished for transgressing these obligations and for acting against moral and logical ways of practice, as the generation of the flood was punished in the days of Noah."