Why was the Soviet Union unprepared for hitlers attack?

Because the soviet union were allies with Germany and didn't expect Germany to attack them.