Yes, they can (not including pre-exisiting contractual obligations, if any). In addition, my state is an at-will employment state so I can be fired for nearly anything.
A company can demand I don't smoke or do other drugs. It can fire me because it didn't like my letter to the editor. It can dump me if it discovered my secret porn career or membership in the KKK. It can demand I live within a certain geographic distance of the office place. And on and on....
My current contract prohibits "moral turpitude", "conduct tending to bring discredit upon the company", and "making public statements to the detriment of the company, its management, or its board of directors" among other things. And that's whether I do it at work or in the privacy of my own home (though how would they know, I wonder?)
I also work in an "at will" state, so I can be fired for no reason at all.
Why do I put up with this? Well, they pay me insanely well for what I do, of course.
On the other hand, if I decide I would like to engage in moral turpitude, I can also quit and go work for the government. Maybe I could get a grant from the NEA if my morals became really turpitudic (is that a word? ;-)