News reports said the wall was originally planned to be 1.8-2.1m high but was reduced to 1.2m after it received widespread publicity.
Senior government official Bijal Patel said the wall was built "for security reasons" and not to conceal the slum.
"Apart from security reasons, the wall is also part of a beautification and cleanliness drive," she said.
Several political leaders were quick to criticise the wall's construction, questioning Modi's development work in his own state. Modi was chief minister of Gujarat for 12 years before becoming the country's prime minister in May 2014.
Authorities also served eviction notices to 45 families living in another slum area near the cricket stadium.
The residents said they were asked to leave because of the upcoming event, but the city's civic body denied it.
"We have been living here for the last 20 years and now we are suddenly being told to vacate because some important leader is visiting this city for a day," said Sanjay Patani, a resident. "This is injustice."
Kishore Varna, a government official, said the land belongs to the civic body and evictions were done under the law. He didn't say why the eviction notices were sent just days ahead of Trump's visit.
Trump, who has pledged to build a wall along America's border with Mexico to stop people from entering the US, is visiting India on February 24-25. His visit is aimed at smoothing ties strained by trade disputes and could also allow him to woo tens of thousands of Indian-American voters ahead of the US presidential election.
Trade tensions between the two countries have escalated since the Trump Administration levied tariffs on steel and aluminium from India.
India responded with higher tariffs on agricultural goods and restrictions on US medical devices, prompting the US to retaliate by removing India from a decades-old preferential trade programme.
- AP