The candidate for Westmorland and Lonsdale gave his resignation on the same day the Eurosceptic party suspended two of its other members.
The announcement comes just a few days after Ukip MEP David Coburn was heavily criticised for likening a Scottish Government minister to the convicted terrorist Abu Hamza.
The Scottish surgeon explained his reasons for resigning to the The Westmorland Gazette, saying: “I have given my full resignation to the party because of issues happening in Scotland: open racism and sanctimonious bullying within the party.
“This sectarian racist filth in Scotland needs cleaning up. It is a great threat to the Eurosceptic cause and civil society.”
A Ukip spokesman said: “We are treating Mr Stanley’s comments with the incredulity they deserve.
“Mr Stanley and the party have been drifting apart politically for sometime and his resignation comes as no surprise to us. However, we wish him all the best for the future.”
Elsewhere, detectives were brought in to investigate an allegation of fraud following the suspension of Ukip MEP Janice Atkinson over claims that a member of staff attempted to overcharge EU expenses.
Ukip also suspended Stephen Howd, its Scunthorpe Westminster hopeful, while an investigation is carried out into an “alleged incident” at his workplace.
Prime Minister David Cameron claimed it was “just the latest in a whole set of catastrophic blunders, disasters, missteps by this party”.
The Kent and Essex serious crime directorate is reviewing the fraud allegation linked to Ms Atkinson.
Officers acted after the Sun newspaper reported that a staff member obtained an invoice from a restaurant for a sum more than three times the actual cost of an event, apparently with the intention of claiming it back from Brussels funds.
A Kent Police spokesman said: “The allegation is being reviewed and the investigation is ongoing.”
The owner of the restaurant that hosted the function said he blew the whistle when he became aware that taxpayers’ money might be at stake, not that of a private donor.
David Goulding, of The Hoy, said: “She explained to me that it was a way of them getting some funds into their Ukip account to help with their campaign.
“I didn’t really have a problem with that as it was a sponsor.
“The problem for me became apparent when I found out that you and me and the rest of the British public were the sponsor because they were claiming the money back off the EU which we pay into.”
Conservative MEP Sajjad Karim - who chairs the European Parliament’s anti-sleaze advisory committee on the conduct of members - said he was seeking an investigation into the expenses practices of Ukip MEPs and others in its grouping.
“What is even more concerning is whether this is systematic of the activities that may be being carried out within this group,” he told BBC Radio 4’s The World At One.
“I think there are now plenty of grounds to put forward an argument, and I certainly am, to the president of the European Parliament, Martin Schulz, to open up a much wider investigation into this particular grouping’s finances.”
A Ukip disciplinary panel will determine on Monday whether Ms Atkinson, who found herself in hot water last year after she was caught by TV cameras calling a Thai woman a “ting tong”, should face action over the allegations, the party’s leader Nigel Farage said.
Ms Atkinson was due to challenge the Conservatives in Folkestone and Hythe on May 7, but has now been suspended from the party whip and removed as a general election candidate while the party investigates the claims.
The Sun reported that one of Ms Atkinson’s staff members obtained an invoice from a restaurant for a sum more than three times the actual cost of a party event.
It said the individual told the manager of the restaurant: “The idea is we overcharge them slightly because that’s the way of repatriating (the money).”
The £950 food and drink cost of the event, held ahead of the party’s recent spring conference in Margate, was reportedly paid by credit card, according to the report, which included video footage of the discussions over the bill.
But it is alleged that the staff member negotiated for and accepted an invoice for £3,150, made out to the newly-formed grouping of right-wing parties Alliance for Direct Democracy in Europe (ADDE) of which Ukip is the biggest member and its associated foundation the Initiative for Direct Democracy in Europe (IDDE).
Mr Farage told LBC radio: “I was deeply shocked when I saw it. It was one of the most incredibly stupid and dishonest things I’ve ever seen in my life.
“This was a member of staff. Exactly what the relationship between that member of staff asking for a false bill and Janice Atkinson is, I don’t know.”
He added: “I spoke to her after midnight last night. She was in bed. I said ‘What on earth’s going on? What is this?’. She said there was a confusion, there was a mess-up. I didn’t get a clear answer. She was asleep when I called.”
The party was quick to stress that the decision meant Ms Atkinson was no longer its general election candidate in the seat, where Tory Damian Collins is defending a healthy majority of 10,122.
It also confirmed it has suspended another candidate over a separate incident.
“Ukip has suspended the Scunthorpe PPC, Stephen Howd, whilst an investigation takes place into an alleged incident at his workplace,” a spokesman said.
SCOTSMAN TABLET AND MOBILE APPS