It is marketing 101. And it is free marketing for McDonalds, btw. You create a demand, increase the legend, get people who normally didn't give a fuck about R&M to wonder what is special about the sauce that is going for hundreds on Ebay. You basically generate a consumer base of people who may not normally go to McDonalds.
Then you release a wider scale release. All the pent up demand floods out and you get a massive bump in traffic. If demand is solid enough after the initial bump, you use the McRib/Shamrock Shake model: Make it a annual or whatever limited release to help drive consume demand. Same reason why Pumpkin Spice coffee usually isn't served year round: You don't want the consumer to tire of it too quickly.