On the issue of formation of relationship among law, morals and religion from the past to the present times