Project may be benefitting a professor's personal company I'm currently taking an elective course on renewable energy that is open to undergraduate seniors and graduate students. Our class project is to design a solar power system for a community in a developing country (including simulations with HOMER and HelioScope) and write a final report targeted for government officials in the country.
A professor from another university has been advising us on this project over Zoom (at the invitation of the course professor), providing us with background information on the community we're designing the system. My group believes the advising professor has a vested interest in the success of this project after we found a recent contract awarded by the government in the developing country to a consulting company to build a solar power system similar to the one we're designing.
There is no direct link between the advising professor and the company since there is very little publicly available information about it, but:

The company is called _____ Technologies, where the blank is the nickname used by the advising professor.
The company has two offices listed on their website, one within ~15 miles from the university the professor teaches at and the other in the developing country we're designing the system for.
The system we're designing has the same capacity and is intended for the same location as the system specified by the contract awarded to the company.

Throughout the entire semester we have been reminded that our final reports for this project may be selected to be read by government officials in the developing country. There hasn't been any disclosure regarding a personal stake by the advising professor, and the course professor introduced him a subject matter expert who is helping out by providing advice regarding the project.
How should we approach this? The advising professor is a friend of our course professor, and we don't know if our course professor is aware of the contract.
Assuming the professor's intentions are indeed as presumed, I think this is a problem for two reasons:

The students did not consent to being used as workforce.
Regardless of the extent of their contribution to the final product, the forced use of any uncompensated workforce means somebody who is qualified to get hired and do the job  will not be getting hired, removing jobs from the market.

From a legal point of view, the professor may have every right to do what he is doing. If not, that is a problem on its own, and has been addressed in @Spark's answer. Otherwise, all the secrecy surrounding the matter was not necessary, and had he been more transparent, I highly doubt that any of the students would refuse to do the assignment.
For reasons of my own, this reminds me of the consent crisis surrounding pelvic exams performed by medical trainees on women under anesthesia. Perhaps since decades, it was considered ok for medical students and trainees to do such pelvic examinations. However, when the recipients found out about it, they felt exploited. Same here. There is a very fine line here: most women actually tend do provide consent to such practices if discussed prior to the procedure, but when found out about it afterwards, most find it shocking. The professor could have been more transparent, which would have had the additional benefit of helping the students feel not violated.
As an example supporting my latter point: in the United States, most universities typically have policies to limit the voluntary presence and participation of visiting scholars from other countries in research activities. This is because there are plenty of talented individuals from other countries who are ready to pay out of pocket to come to the US to progress their careers. It is easy for a primary investigator to run their lab relying on this freely acquired talent and preserve their grant money for other things. However, this prevents everybody (US citizens and foreigners alike) from actually getting paid research positions in labs. Policies as such aim to prevent this from happening and is for the benefit of everyone.
As far as you are concerned, some of you who graduate from your class may be potential employees for the professor in question, and if he keeps getting things done with free talent like yourselves, well, he will be needing you less. Future employment may be a very valid concern to approach your professors with.