Yes. I am going to assume that there is no contract in place with company A (if there IS a contract, reply and let me know).
If there is no contract, a company is free to forbid a contractor to work for another company and/or to take contract jobs from another company. This is not unusual. For example, I doubt that a third party contractor that transports Coca Cola is allowed to do the same with Pepsi.
Companies do not have to give you contract jobs. Meaning, you are free to disagree to this constraint. But if so, they simply do not have to give you the freelance jobs, then.
Please note: If I tell you simply what you wish to hear, this would be unfair to you. I need to be honest with you and sometimes this means providing information that is not optimal. Negative ratings are reserved for experts who are rude or for erroneous information. Please rate me on the quality of my information; do not punish me for my honesty.
I hope this helps and clarifies. Please use the SEND button to keep chatting, or please RATE when finished. You may always ask follow ups at no charge after rating. Kindly rate my answer as one of THREE OR MORE STARS and then click FINISH to submit that rating, as this is how experts get credit for our time. Rating my answer the bottom two stars (or failing to submit the rating) does not give me credit and reflects poorly on me, even if my answer is correct. I work very hard to formulate an informative and honest answer for you; please reciprocate my good faith with a positive rating (it does not cost anything extra to rate).