The CPI basket includes all sorts of non-big Mac related items. For instance, residential housing, commute costs and so on.
Even within the CPI basket, the basket is an average. Certain things will go up more than the average in certain things will go up less, but that’s how averages work. Check out the breakdowns on how the various index components of gone up and down over time.
A Big Mac can also be considered to deliver roughly the same perceived value to the customer over decades which is useful for an inflation metric. This is in contrast to items prone to technological efficiency gains which are getting cheaper and are favoured by CPI weighting adjustments.
And still, even considering the efficiency gains and cost reduction for energy and transportation the cost of a Big Mac still does not fluctuate around the CPIs 2% average. Its average annual inflation over the last 20 years is ~4% and roughly twice as high as CPI claims.
If the Big Mac would be an item in the CPI, it would gradually be removed from it because the more expensive it becomes, the less Big Mac's a person would buy.
Arguing that items which become more expensive are rightly removed from the CPI because they become "unnecessary luxury items" is fine for modelling consumer behaviour, but misleading for establishing inflation metrics.