Celtics need a center that can protect the rim and a backup for Kemba.In this trade they solve both problems and manage to trade Hayward's big contract.
Pacers will take the deal because it include the 14th pick,which they can use to trade for an upgrade on some position and because Hayward is what Pacers kinda try to find.