The U-turn comes after council officials on Tuesday said the infection rate was at 2.6 per 100,000 but less than 24 hours later, health bosses said this was now at 10.6 per 100,000.
Bosses said organisers had met the 10 public health tests on Tuesday to allow fans in albeit in a reduced capacity.
DMBC director of public health, Dr Rupert Suckling, said he took the decision on the back of Prime Minister Boris Johnson’s ban on social gatherings of more than six people from September 14.
He added that a delay in test results and ‘other factors’ played a part in the infection rate rising overnight.
Around 2,600 fans will be allowed to stay at the event after arriving on Wednesday morning but no fans for the following three days will be allowed entry.
All customers supposed to be attending over the next few days will be contacted by the racecourse.
Dr Suckling said: “I have been reviewing the public health situation regarding the St Leger Festival taking place at the racecourse today.
“There are two factors I am considering – the first being the Government’s announcement of the further restrictions of people meeting in groups of more than six people and the second is the risk of infection rates rising if people use this weekend as a final chance to congregate in bigger groups. Therefore I am currently speaking to the racecourse on the future of the event with spectators.
“I am assessing the situation daily against the 10 tests I set out to hold the event. I am concerned that the 10th and final test covering critical incident risks addressed throughout the event such as managing gatherings of people, public disorder risks across the borough, will be jeopardised by potentially more people meeting up ahead of any further Government changes to the coronavirus advice this weekend.
“Therefore on the grounds of public health and public safety I have instructed the racecourse to hold the St Leger Festival behind closed doors from tomorrow. The day’s racing will continue today as it is safer to manage racegoers on site and with enhanced test and trace, it will be easier to identify where they are from rather than closing the event today and leaving people to their own devices in Doncaster and the borough generally.”
Mark Spincer, MD of Arena Racing Company Racing Division, said: "This pilot event represents a hugely important step not just for our business but for the whole of British racing as well as the sports and hospitality industries as a whole. We do, of course, fully understand and respect the decision and will be contacting all of our customers booked for the remaining three days as a matter of urgency.
"We were pleased to work closely with Doncaster Council to set up this pilot event in the manner that we had but matters beyond anyone’s control, and the data that regarding local rates that have come to light today, mean we will not be able to welcome a crowd from Thursday onwards.
"We would, of course, like to thank all of our customers for their support in the run up to this event as well as our staff who have done a monumental job in preparing the site.”