There is no law that forces McDonald's to extend you a franchise license. It's their right to run their brand how they want.
Part of the franchise contract would be an agreement to use their approved vendor/parts list.
If some law passed and McDondald's was going to lose control of franchises, consistency and their brand, they'd probably pivot to a mostly or entirely corporate-owned/operated model.
However, it's unreasonable to assert a franchise should be able to use whatever devices, machines, standards and consistency they want... which is what is being advocated here it seems.
As an aside, your example about refusing to sell a license to someone based entirely on the color of their skin would be quite difficult to prove and enforce. I'm not advocating for anything, just pointing out they can deny a license for pretty much any reason, or no reason, and nobody would be able to compel them otherwise. It is their brand, and nobody has a right to operate using that brand unless McDondald's allows it. That's the entire point of a franchise - use someone else's brand.
Contracts cannot remove all rights. For example, they can't force you to place yourself in harms way, or to harm others.