They were influenced by Daoists. Daoists espoused an everchanging world with contradictions which resolved themselves only to give birth to even more contradictions. This is in contrasts to Mohists and Confucians which espoused a world that does not change. Confucians believed in destiny that is ordained by Heaven while Mohists believed in destiny that is ordained by a sky god also confusingly called Heaven. Mohists, despite being neither dialectical nor materialist, at least advocated for an egalitarian society while Confucians advocated for a society where everyone knew their place within the social hierarchy.
The consequence of Confucians being undialectical is that most of their works constantly orient themselves based on the reported actions of the sage kings of Yu and Xie. Do X because Yu also did X. Don't do Y because Xie didn't do Y. Meanwhile, Legalist works stress the sovereign has to constantly adapt their actions based on the informed observations of their ministers (and methods to make sure ministers actually report what's going on which mostly amounted to ruthless punishment). This is not the case of Confucians not being materialist especially since one branch of Confucians was headed by a full blown atheist. It's this atheist Confucian who taught two students who then go on to take the dialectical aspects of Daoism to develop Legalism.