It was not Stalin who said this, it one of main postulates of Marxist philosophy stemming from German classic philosophy.
Well, I’d bet Stalin said it at one time or another. ;>)