The difference in this case is that Prince Charles already had two heirs from his first marriage with the deceased Princess Diana Spencer (Prince William and Prince Henry). Should he have another child with Camilla Parker Bowles (very unlikely, considering that she was 57 when they married), that child would have been 3rd in succession after Charles, but would have gotten pushed further back by future children and grandchildren of William and Henry (as of 2020, William has 3 children and Henry has 1). That means his marriage was of little concern for the throne succession. Also, Camilla Parker Bowles is the daughter of a 3rd baron, so she has at least a bit nobility.
Edward VIII, however, had no children yet when he wanted to marry Wallis Simpson. That means his heir would have come from a twice divorced woman (and an American and lowborn, to boot), which would have been the big scandal the prime ministers wanted to avoid.
Also, back then Edward VIII could not even have married her according to the Church of England. At that time the church did not allow divorced people to remarry as long as their ex-spouse is still alive. That means as far as the English Church was concerned, his children would have been born out of wedlock, which would have questioned their legitimacy. The church's opinion in this case is important, because the King of England is also the head of the Church of England. The head of the kingdom and head of the church living in a marriage not recognized by the church and expecting the children of said marriage to take the throne after them would have been difficult, to say the least*.
However, in 2002 the Church of England liberalized their stance and allows divorced to remarry at the discretion of the priest. The marriage between Charles and Camilla was in 2005, and the church gave permission to it.
*And no, using his power as head of church to change its rules might not have been a good idea. The last time an English monarch changed the state religion to accommodate their personal marriage plans, lots of people died