Standing in the grounds of Hendon FC, William said racist abuse recently directed at Chelsea’s Tammy Abraham and Inter Milan player Romelu Lukaku was “outrageous” and he was "fed up" with it.
"Things have been going backwards, rather than forwards," he said.
"People have been standing together and I think in this moment, that’s all we can do."
He said social media companies and clubs need to do more, because there is only so much players can do to combat the issue.
"We have to rely on the campaigns and stuff like that to deal with the situation because our voice only has so much power," said the striker.
Rashford suffered a torrent of racist abuse on Twitter in late August, after he missed a penalty in a game against Crystal Palace.
William, president of the Football Association (FA), spoke out as he met staff, coaches and fans at Hendon FC on Friday to learn about their mental health outreach activities.
The club, which plays in the Southern League Premier Division South, the seventh tier of English football, works in partnership with the Brent Early Intervention Service to provide people facing mental health challenges access to its training facilities.
The visit was part of efforts to promote the new Heads Up campaign, a joint initiative from the FA and the Heads Together charity, seeking to raise awareness and encourage conversations around mental health – particularly among men.
Darren Smith, who uses Hendon’s facilities to run education programmes from the University Campus of Football Business (UCFB), said the issue of racism in football was “huge” - and had a huge impact on mental health.
“It went quiet, but it never went away,” he said, highlighting the way some abusers used anonymous social media accounts to “not be accountable”.
Smith added: “It can’t go untouched, we need to do something about it, because football should be for all, and for certain groups to feel they are not welcome is not right.
“It has an impact not only on mental health but the aspirations of our young people.”
He said: “I have a lot of students that are from minority groups, its stressful going through a degree but also what happens at the end? Am I going to be accepted into the football industry?”
Asked if he felt the William took tackling the issue seriously, he said: “100%. It sounds like he wants to take it further, which is great, we need more public figures, people with power or positions to take it forward.”
A group of young people have formed Hendon FC Mental Health team and now take part in specially tailored weekly training sessions at the club.
As a match played in the background, Prince William spoke with some of the young men who had benefited from the initiative.
Afterwards, Jermaine, 24, a local hospital inpatient, said there had been a “big change” in his well-being since becoming involved in the programme.
“I’ve developed a lot physically, mentally and emotionally,” he said.
“It’s made me more stable and given me more courage to succeed in what I want to do.
“It’s good to bond with new people and mix with people who are going through the same situation. It’s good to learn from people and help each other.”
Another programme participant Jahanzeb, 21, who has been diagnosed with psychosis and lives five minutes away from the club, said he used to live a more “secluded” and “closed” life.
“I was at home a lot, I didn’t want to get out of the house,” he said.
But after two years on the programme, he now feels more “active” and “social”.
He added: “I feel like I’m more part of society now, before I was a bit bed bound, lazy. It’s give me hope, motivation and confidence.”
The mental health outreach project at Hendon has been driven by Richard Hay, a support worker for Brent mental health services, who saw the need to find new ways to boost the wellbeing of the people he works with.
He said: “I felt the need to create this programme to take tackle the physical health concerns and tackle the apathy and lack of motivation, to engage them in meaningful activities.”
Mr Hay said participants had found their sleep and stamina improve alongside a reduction in their mental health symptoms.
“This programme breaks down the stigma within the group itself,” he added.
“They needed to have each other and that respect to create some kind of normality.”
“Their health and mental state has improved big time,” he said.
Mr Hay said the duke as “very encouraging” and “caring” as he met with project users and their carers on the pitch.
“He comes across very open and understanding about mental health issues,” he said.
“One of the mother’s got upset and he was very comforting, he was very warm.”
Ahead of the duke’s arrival, fans and staff members took photos of the FA cup sat in the small clubroom.
Hendon are due to take on Little Common in the FA Cup first qualifying round on Saturday.
Another crucial supporter of the mental health project, which launched in 2017, is club vice-president Robert Morris.
“These are all people seriously affected by mental health,” Mr Morris said, who is also co-owner of its ground at Silver Jubilee Park.
“Some have psychosis, some of them hallucinate, some of them self harm, some can’t even get out of bed in the morning.”
He said playing football allowed people to “forget about everything”, and some project participants had already gone on to full-time employment or education.
“We’re now starting to see them socialise, they are in Whatsapp groups together and we’re now seeing some of the older members starting to mentor the newer people, they are starting to help each other which is absolutely amazing.”
Mr Morris said the club had a “huge sense of pride” in the project, adding: “We’re trying to break down the barriers, we don’t want any stigma here, we want everyone to feel safe.”
“There’s something nice happening here, something rather wonderful, and the community and the fans are buying into it.”