The brick wall in the Gujarat state, which blocks an area that is inhabited by more than 2,000 people, has been condemned by residents.
Keshi Saraniya said: "Since they are spending so much money on this wall, why not use that to improve our slum and provide better facilities for us."
He added: "Why are they hiding us poor people?"
The US president is visiting the city of Ahmedabad in Gujarat during a two-day trip to India next week to attend an event called Namaste Trump, which translates to "Greetings, Trump".
Mr Trump is to drive along a road next to the slum and will be accompanied by Mr Modi, who is from Gujarat.
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 added.
However, this isn't the first time Mr Modi has pulled out the stops to impress a US President, in 2015, he broke protocol and welcomed Barack and Michelle Obama on the tarmac.
Meanwhile, several political leaders were quick to criticise the wall’s construction, questioning Mr Modi’s development work in his own state.
He was chief minister of Gujarat for 12 years before becoming the country's prime minister in May 2014.
Authorities on Monday 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.
Sanjay Patani said being asked to "suddenly vacate is injustice".
He added: "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."
Kishore Varna, a government official, said the land belongs to the civic body and evictions were done under the law.
He did not say why the eviction notices were sent days ahead of Mr Trump’s visit.
The US leader, 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 Washington to retaliate by removing India from a decades-old preferential trade programme.