So, presumably they own the code, which means they can do whatever they want with it. The best you can likely do is advise them that it may provide them a competitive advantage to not allow other companies to use the same code. The other contractors involved will definitely not own the code. They will only be able to use it as dictated by the company for which you wrote it.
I am not a lawyer; this is not legal advice.