It's not just lawful court orders, over the years many explicit and implicit "suggestions" about "risk" have been issued to banks to discourage activity deemed undesirable. https://en.wikipedia.org/wiki/Operation_Choke_Point