First, the Soviet Union was in a constant state of competition with the United States, and both countries were engaged in a massive arms race. Each country was trying to outdo the other in terms of military strength, and this required significant investments in military spending.
Second, the Soviet Union was also facing threats from its Eastern European satellites, which were becoming increasingly restive and demanding greater autonomy. In order to maintain control over these countries, the Soviet Union needed a strong military presence, which again required increased military spending.
Third, the Soviet Union was also involved in a number of military conflicts around the world, including the Korean War and the Vietnam War. These conflicts required significant resources and manpower, and they also contributed to the Soviet Union's increased military spending.
Finally, the Soviet Union's military-industrial complex was a major part of the country's economy, and it had a strong influence on the government. The military-industrial complex was constantly lobbying for increased military spending, and it was often successful in getting what it wanted.
As a result of all these factors, the Soviet Union's military spending increased dramatically over the years, and by the late 1980s, it accounted for nearly a third of the country's GDP. This level of spending was unsustainable, and it eventually contributed to the collapse of the Soviet Union.