First sale doctrine is only for retail sales that have no contract outside the sale.
In distribution, contracts can absolutely dictate terms. This is a good thing. It lets, for instance, Boeing require purchasers to properly maintain airplanes (it hurts Boeing when they fall out of the sky). It also lets manufacturers offer lower prices on the condition that products be displayed or promoted in certain ways. This is very common in retail ("we'll give you 5% off quantity 100 on the condition they're promoted in ads and an endcap in each store").
The Apple / Amazon example is resale price maintenance. There's some good background on US law in the area: https://en.wikipedia.org/wiki/Resale_price_maintenance#Unite...
In this specific example, where the claim is that Amazon and Apple colluded to raise prices by only allowing authorized Apple resellers on amazon.com, I guess I'm kind of sympathetic to Apple. At least inasmuch as they can show that sales from unauthorized resellers generate more warranty/support/other expense, or brand damage from even worse stuff like fraud and counterfeits.
It seems like the real complaint is with the resale price maintenance in Apple's authorized reseller program. Which may be a fair complaint. But why not go after that? If the price maintenance is illegal, it should be illegal everywhere, not just Amazon. And if it's legal, it should be legal on Amazon as well.