There is only one answer to the question and it is a very simple answer. In ancient India the Bramhins were the only educated class. They were also the Class which was claiming to be above all others. Buddha disputed their claim for supremacy and declared a war on the Brahmins. The Brahmins acted as an Educated Class—as distinguished from an intellectual class—would act under the circumstances. It abandoned all pursuits and engaged itself in defending the claim of supremacy and the social, economic and political interests of its class. Instead of writing books on Science, the Brahmins undertook to write Smritis. Here is an explanation why the progress of science in India became arrested. Brahmins found it more important and more imperative to write Smritis to repel the Buddhist doctrine of social equality.
N. B:- Please read What are Smritis.
CHAPTER-7 The Triumph of Brahmanism : Regicide or the birth of Counter-Revolution, part-III. Revolution and Counter-Revolution in Ancient India, Volume-III. Dr. Babasaheb Ambedkar Writing and Speeches