Why was the GOP allowed to insert earmarks into the spending bill for members who voted against it anyway (and who supposedly oppose the practice of earmarking itself)?

As G.O.P. Rails Against Federal Spending, Its Appetite for Earmarks Grows https://nyti.ms/40p1G9P

As G.O.P. Rails Against Federal Spending, Its Appetite for Earmarks Grows

While Democrats claimed a larger share than Republicans of the nearly $16 billion in earmarks in the latest federal spending bill, G.O.P. projects jumped by 85 percent.