The record penalty comes after the Gambling Commission found new customers were able to bet large sums over short periods without proper checks.
In one case, a customer was allowed to open a new account and spend £23,000 in 20 minutes without any checks.
The commission "seriously considered" suspending William Hill's licence.
It found several failures to guard against possible money laundering, with customers allowed to deposit large amounts without the business conducting appropriate checks.
One person was able to spend and lose £70,134 in a month, while another deposited £73,535 and lost £14,068 in four months.
"When we launched this investigation the failings we uncovered were so widespread and alarming serious consideration was given to licence suspension," said Andrew Rhodes, the Gambling Commission's chief executive.
"However, because the operator immediately recognised their failings and worked with us to swiftly implement improvements, we instead opted for the largest enforcement payment in our history."
Mr Rhodes told the BBC's Today programme the commission had seen "immediate and significant improvements" under the company's new management, 888, which took over William Hill last year.
888 said the problems had happened under the previous ownership and management. "After William Hill was acquired, the company quickly addressed the identified issues with the implementation of a rigorous action plan," a spokesperson said.
Among the issues uncovered by the commission:
* one person was allowed to open a new account and bet £32,500 over two days without any checks
* the group failed to identify customers who were at risk of experiencing gambling related harm. In one instance, a customer lost £14,902 in 70 minutes
* the group failed to apply a 24-hour delay between receiving requests for an increase in a credit limit and granting it. One customer was allowed to place a £100,000 bet immediately, even though he had a £70,000 credit limit
* customers were able to place large bets without sufficient checks on the source of the funds being carried out
* the group failed to ask for source of funds evidence when one customer staked £19,000 in a single bet, and did the same in another case when a punter bet £39,324 and lost £20,360 over 12 days.
"The reason we have the requirements to have controls in place is to stop people being able to spend such large amounts of money so quickly without intervention," Mr Rhodes told the BBC.
"It may be that they can't afford it, it may be that it's a choice they want to make, but we have to have safeguards in place, and William Hill accept that they simply didn't have them at this time."
Under the settlement with the William Hill Group, WHG (International), which runs williamhill.com, will pay £12.5m, Mr Green, which runs mrgreen.com, will pay £3.7m and William Hill Organization, which runs more than 1,300 betting outlets across Britain, will pay £3m.
The £19.2m collected from the penalties will go towards "socially responsible" good causes.
The previous largest penalty imposed by the Gambling Commission was £17m against Entain last year.
Despite the penalties, Mr Rhodes said there were now "signs of improvement" in gambling operators' behaviour.
"There are indications that the industry is doing more to make gambling safer and reducing the possibility of criminal funds entering their businesses," he said.
"Operators are using algorithms to spot gambling harms or criminal risk more quickly, interacting with consumers sooner, and generally having more effective policies and procedures in place."