Sadly, legal or not, tailored specs are the norm.
At a previous job, our company and three other companies operated similar programs, supporting the military. Call it company A, company B, and company C. Our company (company A) were doing a really good job. Our metrics were outstanding, we had the enthusiastic support of 3 consecutive commanders of the unit we were supporting, life was grand. Company B was also doing a great job, and they were better than us at certain things, but as a whole, we were slightly better. Company C suuuucked. Their metrics were shit, so they started gaming the metrics. Their metrics still sucked. The people in the unit we were supporting were well aware of their bullshit, and they regularly got dressed down in front of all us. They were absolute dogshit.
Imagine Firefox vs Chrome vs IE6. In the general case, you want Firefox, (Company A) unless you spend a significant amount of your time using Google Docs, in which case you want Chrome. (Company B) You don't want IE6.
Anyway, the Pentagon needed to select one of these programs to build into a long term DoD program, as opposed to a live in theater prototype, so they commission a study to evaluate the three programs. They hired an outside contractor to perform this study. The company they hired to perform this study was Company C. Company C's study showed that Company C's product was the most effective one. Their numbers were straight up lies- they literally made up bullshit and wrote it down on a piece of paper and submitted it to the Pentagon as a formal document. The unit we were attached to was livid, and wrote up a formal complaint to the Pentagon. This was ignored.
Our program was canceled, I was laid off. I don't work in defense anymore.