The roots of Sociology as a modern discipline:

European Enlightenment and Scientific Revolution

So it basically arrived from us thinking scientifically about things rather than relying solely on empiricism , as the faith in religion dropped we started believing in society without the fear of god, there is a beautiful quote around this which says
**" it is not god that keeps the morality in us, it would be very pathetic if humans behaved nice for a seat in heaven"