Uni group project being used by companies for profit
This question splits into a few parts.

First, are there malicious arrangements where people abuse students as labor?

Yes, there are. and this fear seems to be motivating what you are writing here.

There can be and have been instances where professors collude with companies to use their students' code or other forms of labor with the only compensation being credits. Chinese graduate students often described such things to me when they were in the US (particularly when they had advisors who also spoke Chinese and threatened their visa status and continued education to get them to cooperate).

Second, is this arrangement (the one you describe in the question). such a malicious arrangement?

That's not completely clear, but the answer is probably no. (1) there's nothing per se wrong with having your projects be used or evaluated by companies. If anything that's a great opportunity for real world exposure. (2) you can ask the professor in charge or speak with the IP office at your university and see if all of this is happening in accordance with UK law. Assuming you're not being forced to abandon your rights to take the class, there's no obvious abuse here. Presumably, you can even refuse to sell / grant rights even if a company is interested.

tl;dr - the mere fact companies will consider what you produce is not  enough to constitute abuse.