Sharma, who was in Ghaziabad for a school programme, told reporters that Gandhi was attempting to link all issues with politics to win the Assembly polls in Gujarat this month.
"Congress is trying to divide the society for its political motive," he alleged.
Gandhi has been campaigning extensively in Gujarat. He has attacked the BJP, which has ruled the state uninterrupted for the past 22 years, on many issues, including the chaotic implementation of the Goods and Services Tax (GST) in July and the demonetisation of high-value currency in November 2016.
The Congress leader has even been visiting temples in the poll-bound state, inviting criticism from the BJP that he was playing a "soft-Hindutva card" ahead of the Assembly polls.
In his interaction with the media, Sharma said that a Ram Temple will be built in Ayodhya as per the Supreme Court order.
"Rahul Gandhi and the Congress party must clear their stand on the issue of Ram Mandir. In Gujarat, Rahul Gandhi is trying to give communal colour to (his party's) election campaign," the deputy chief minister of Uttar Pradesh said.