I think there were three items which contributed to the high casualties (in addition to the sub-human activities of the German SS and other non-standard units).
First, Stalin had jailed or had shot much of his officer corps in the 30s. Their replacements were not up to the same standard.
Second, Stalin genuinely believed that Hitler would not invade after they signed their treaty. He ignored various warnings and lost hundreds of thousands of troops in the initial days of the invasion. This was criminal negligence.
Third, Stalin did not allow his officers freedom of action in the field. He micromanaged his officers and didn’t allow them to respond to the field conditions (e.g., the use of blocking troops to shoot anyone who retreated). Huge numbers of troops were lost to encirclements which were completely unnecessary.