It doesn't make a classless society, but it is necessary at least for a short while to establish the class rule and an actual path towards socialism and withering away of the state.
You can't have socialism without having all of people's needs met which requires repurposing the means of production, you can't have socialism without strong control during the post-revolutionary period given the counter-revolutionary tendencies of bourgeoisie/third-party opportunistic groups (most revolutions happen in pairs/chains, its the most volatile period) - that's the purpose of the period of transition.
Historically, countries such as USSR, China (though its a question if China's revolution was proletarian at all) and later didn't get past the transitionary period because of tens if not hundreds of millions of peasantoids and underdeveloped industry, having them to stay in this awkward period for a long time, which led to complete degeneration of ideology after opportunists took the reigns (like Stalin), who bastardized the meaning of Socialism and essentially caused the countries to become "red bourgeois".