Allegri has been in fault, but Marotta is the one to point fingers here. He overhauled the squad without any direction, made head scratching last time deals and pulled the team together in the last day of mercato.
Injuries have also been a mess, and that's on the poor preseason planning/physical coaching staff. Don't know if Allegri brought all these guys, I doubt he did.
It's definitely mostly on Marotta. Sacking Allegri would be stupid.