I would think that patently illegal. The employer cannot dictate who their employees socialize with outside of the company. Exceptions being the armed forces, perhaps.

Of course before I was self employed, I was regarded as having an attitude problem. Too true, and this kind of thing is one of the reasons why.