When ticket resellers use StubHub, they can sell the ticket for whatever price the market will bear, but Ticketmaster sets artificial price floors that prevent sellers from listing tickets below face value. This anti-competitive practice has recently been called out by the New York Attorney General, as it deprives fans the opportunity to buy tickets on a fair market.
The Yankees can’t force anyone to use Ticketmaster instead of StubHub, but it can make using the latter a much bigger pain in the ass by eliminating printable tickets. Ticketmaster doesn't rely on pdf-printed tickets, but instead delivers tickets directly to smartphones via a proprietary technology that is (surprise!) the only mobile ticket method accepted by the Yankees. StubHub can't use Ticketmaster's proprietary smartphone delivery method, so it relies on pdf-printable tickets in order to help sellers avoid the need to arrange physical delivery of pre-printed tickets.
StubHub is still the official ticket re-seller of Major League Baseball, but NFL is also engaged in the ongoing battle against StubHub and deprive its fans the ability to sell its ticket in a truly competitive market.