Because at that time in Hinduism caste system was very rigid and there were four castes
Khshatriya - Kings
Brahmins - Saints
Vaishya - Farmers , merchants herderes ( common people )
Shudra - They were all those who did the cleaning work
The vaishya and shudra were discriminated by the other two. Also, all the rituals like pujas and sacrifices of animals were very hard and costly for them. They had to get water lured over them before entering the temples.
Soon,trading started and vaishya came in importance . So they thought that why should they follow the religion in which they were discriminated and is very hard ? So they started joining Buddhism and Jainism as they treated everyone equally and they didn't have such hard rules. Following them , Shudra also got attracted towards the religion