Because in the western world it's such a controversial topic, I've found that half the books that you'll find discussing (from a socialist perspective) the Soviet Union even in a tangential manner, will show an opinion on this.
The book "Human rights in the Soviet Union" by Albert Szymanski does a good job of a material analysis explaining the reasons why states use oppression in Chapter 1, and Chapter 7 is dedicated to "Toleration and Repression in the USSR: 1917-54". The numbers are a bit outdated because it's written before the official numbers came out after Perestroika, but the analysis holds up IMO.
Michael Parenti in "Blackshirts and Reds" does a good job of an analysis in my opinion, showing that the overwhelming majority of Gulag inmates were in fact just petty criminals and not opposition as is most often implied, and puts a perspective on the social situation at the time. I'm guessing this is more the perspective of anarchist socialists, since the book heavily leans towards decentralisation without getting into the historical and material reasons why AES states don't go further lengths in such efforts.
For a perspective on the economic situation of the USSR over all its history, I highly recommend "Farm to Factory: a reinterpretation of the Soviet industrial revolution" by Robert C. Allen. It's a sometimes dry book that goes into high detail on the economy of the late Russian Empire, how it was affected by WW1, the revolution and the Russian Civil War, the details of the Dekulakization and the first 5-year-plans, WW2, and the economic trend until the 70s (economic miracle) and after the 70s ("stagnation" period). A good material analysis on the reasons for oppression can't be done without an understanding of the economy of the country, the distribution and class of labour and the productive forces, etc. The importance and difficulties of a quick industrialisation for the survival of the USSR, which suffered the biggest land invasion of its history barely 10 years after coming out of a jumble made by World War 1, Russian Civil War and Dekulakization, cannot be overstated in my opinion. Also, the economic analysis shows that forced labor from Gulags wasn't a significant source of labor for the country and industrialisation could have been carried out with or without it.
Albert Szymanski's book "Is the red flag flying", there's a brief section (10 pages long-ish) on Stalin in Chapter 10, which starts with a sentence I think every Marxist-Leninist should tattoo on their arm: "It is peculiar that many Marxists who maintain a consistently material position when analysing the development of capitalist or pre-capitalist societies [...] resort to explaining developments in the Soviet Union from the 1920s to the 1950s largely in terms of individual personalities - 'Great Men', personal motivations, power hunger, and so on. This is true of both apologists for Stalin and their arch opponents the Trotskyists". You don't have to like or agree with Szymanski's view on Stalin and the purges, but he's 100% right that a material analysis should be done, and history shouldn't be explained in "big man" theories, which many resort to when talking about Stalin era.
Lastly, the Russian journalist Дудь (has a channel on YouTube called вДудь) made a 2h documentary from a non-socialist perspective talking with family members of victims and stuff like that, describing some of the harshest Gulags mainly in the Siberian region of Kolyma in the far north. It's a bit of a lib piece (in the Russian sense of liberal), but I'm not against the idea and it's much better than the slop you'll find in the western world libs. It's both subtitled and dubbed to English, BTW, if you want to find the video just look up "vdud Kolyma" (or вДудь Колыма) on YouTube or google, it's called "Колыма - родина нашего страха / вДудь".
Hope any of this helps