The quote is from Lenin, in his instructions to Popov when discussing the project of organizing Soviet statistics in summer of 1918:"Statistics, as any other scientific discipline, poses problems and solves them in the interests of specific classes", see Kotz-Seneta, Lenin as a Statistician. Popov, an experienced statistician whom Lenin knew since 1905, was appointed the first head of CSA (Central Statistical Administration), a semi-independent statistical institution that Lenin established in July 1918. He quickly grew suspicious of the ideological loyalty of CSA calling in 1919 majority of its workers "right-wing SR, mensheviks and even kadets". And in 1922 he added:"The CSA should not be "academic" or "independent", which is what it 9/10 is now due to the old bourgeois habit, but an organ of socialist construction". See also Nemchinov, The Use of Statistical and Mathematical Methods in Soviet Planning for broader context.
Stalin was presumably on board with it, at least before WW II. Then the mood changed, see Rossianov, Stalin as Lysenko's editor:
"The renunciation of the ideological heritage of the 1920s and early 30s became an integral part of the postwar Soviet ideological campaigns. For example, in an article published in 1950, Stalin expressed his negative attitude toward the attempts made in the 1920s to create a class-oriented culture (proletkult). From the mid-1930s, the emphasis shifted from revolutionary cultural experimentation to upholding traditional cultural values...
In the new ideological climate, science was considered to depend, not on class interests, but on some "objective" laws of nature. In this respect, the
VASKhNIL session was a landmark: class science had focused principally on methodology; immediately after 1948, the Soviet ideology became reified into a new ontology, a new picture of the world as it purportedly was, articulated by the political leadership. In revising Lysenko's text, then, Stalin was doing more
than changing Lysenko's writing style, or even his rhetoric; he was, in a sense, reconstructing the world. This, perhaps, helps to explain why his changes were so numerous and detailed."
Ironically, the "objective" turn started by promoting Lysenko's pseudoscience over genetics.