this is because they defied and disobeyed allah and his messenger. and whoever defies and disobeys allah and his messenger then verily allah is severe in punishment.
ذلك بأنهم شاقوا الله ورسوله ومن يشاقق الله ورسوله فإن الله شديد العقاب