In a few years when they will have to be paying Judge, Severino, Didi, Sanchez, etc, a lot more money, he will be making $30m a year. Sure for the Yankees that's not a big deal, but still not a very high value contract.
He had over 200 strike outs this year and he was 28 with a 9.9% walk rate. He might have a few more good power years left but when this dude loses bat speed, he's going to fall off like crazy. Those skills don't age well, and he has 9 more years left on his deal.