As a front-bencher you're expected to follow the whip or lose your position. That applies to all parties, it shows everyone else the people in charge are united, it wouldn't look very good if your top cabinet ministers were voting against the party. Corbyn didn't really have a choice here, if he hadn't sacked them then he'd be seen as a weak leader, he sacks them and he's against the EU.
As a front-bencher you're expected to follow the whip or lose your position. That applies to all parties, it shows everyone else the people in charge are united, it wouldn't look very good if your top cabinet ministers were voting against the party. Corbyn didn't really have a choice here, if he hadn't sacked them then he'd be seen as a weak leader, he sacks them and he's against the EU.