This prevents the problem you mention, but it still isn't good for the employee. It does create an incentive for the company to encourage their employees to work more. If they charge for 80 hours in one week, but only pay the employee for 40 the company just made a bunch of extra profit at the employee's expense.
37.115-2 General policy.
(a) Use of uncompensated overtime is not encouraged.
(b) When professional or technical services are acquired on the basis of the number of hours to be provided, rather than on the task to be performed, the solicitation shall require offerors to identify uncompensated overtime hours and the uncompensated overtime rate for direct charge Fair Labor Standards Act—exempt personnel included in their proposals and subcontractor proposals. This includes uncompensated overtime hours that are in indirect cost pools for personnel whose regular hours are normally charged direct.
(c) Contracting officers must ensure that the use of uncompensated overtime in contracts to acquire services on the basis of the number of hours provided will not degrade the level of technical expertise required to fulfill the Government’s requirements (see 15.305 for competitive negotiations and 15.404-1(d) for cost realism analysis). When acquiring these services, contracting officers must conduct a risk assessment and evaluate, for award on that basis, any proposals received that reflect factors such as—
(1) Unrealistically low labor rates or other costs that may result in quality or service shortfalls; and
(2) Unbalanced distribution of uncompensated overtime among skill levels and its use in key technical positions.
-https://www.acquisition.gov/far/current/html/Subpart%2037_1....
Fair enough it isn't legally required. However it is formally discouraged by the government. Also, my particular employer explicitly discourages unpaid overtime and thus it doesn't happen often.
The defense industry in the US is like this. It is illegal for a company to have employees work more that 40 hours a week without overtime pay. The rationale is:
If Company A has a company culture of all employees working 60 hours a week and Company B has a corporate culture of working 40 hours a week, Company A could charge the government less for the same amount of work and thus would win more contracts. The government recognized this would create an customer incentive for companies to "encourage" their employees to work longer hours. So the government made a law that Defense contractor employees must be paid overtime for any hours more than 40 per week. And in my experience, no manager will pay overtime so most non-manager level people really don't work any more than that.