Decimation was a punishment usually reserved for open rebellion and similar capital crimes. So if soldiers took up arms against Rome they’re not really their own soldiers anymore.
Not an excuse but decimation wasn’t a light punishment.
EDIT: the cases subcomments mention fall under the banner of "desertion" and/or refusal to follow orders (essentially rebellion), which, even in modern armies, carries a stiff penalty. Not quite decimation but its a serious crime.