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.
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.