Republicans and Democrats agreed to roll back the requirement as part of an $857 billion military policy measure, acting over the Biden administration’s objections.