It is very much legal. It is called an exclusivity contract agreement. As stated above it happens all the time in different stores, restaurants and bars. Companies pay big money to these establishments for them as well.
For an embelishment on the above example, Say Mcdonalds decides to bring in Pepsi fountains to go beside the Coke fountains, how many millions would coke lose just because pepsi is sitting next to them, same as with coke coming into taco bell. It is easier to the companies that have the contracts to just pay a chunk of this money straight to the account rather than have the account offer the customer a wider choice of beverages. I am not saying that I agree or disagree with it but either way it is what it is and I have no say in the matter. It is like when a new President is elected here in the USA. you either voted for the guy (or gal) and you are happy or you didn't vote for them and you are not. Either way they are the President and there isn't anything you can do about it until it comes up for another vote, then the entire process starts over.
If what you did yesterday still looks big, you haven't done much today.