This restriction seems to be politically motivated, introduced after the invasions on India began, to protect the temples. For example, not wanting to reveal the wealth inside the temples to non Indians (who were mostly Hindus, Jains and Buddhists). I do not believe there was religious discrimination, especially in the all-embracing Hindu culture.
It probably is time to look into the reasons why this practice came into being and decide whether it makes sense to keep it alive.