Rees-Mogg's intervention came after pressure from Lord Peter Hain, the veteran anti-apartheid campaigner, who had urged Boris Johnson's government to punish Bain for its "despicable" behaviour.
Initially, Cabinet Office officials advised that no action against the company was necessary but Rees-Mogg sought further advice, including from an external QC.
He told Hadley that the company would be banned from Cabinet Office contracts under 2015 legislation on the basis that "Bain & Co is guilty of grave professional misconduct which renders its integrity questionable".
Rees-Mogg, who will advise all government departments to apply the same three-year ban, said he was particularly concerned at the way Bain's South African division "colluded" with the regime of former president Jacob Zuma to undermine the country's revenue service.
The consultancy has been awarded UK public sector contracts worth up to £63m (NZ$122m) since 2018, including £40mn worth of Brexit consulting work for the Cabinet Office, but the damage to the company will be mainly reputational.
In a letter in February to Hain, the then Cabinet Office minister Steve Barclay wrote that the company was "not a strategic supplier to the government and is not currently undertaking any substantial work for the government".
Hain said: "I'm very pleased. This sets down a marker for all companies which behave in an unlawful, unethical and unprofessional way that they won't be able to tender for government contracts.
"I commend Jacob Rees-Mogg for doing this and I want the US government to do the same thing."
Bain said: "We were disappointed and surprised by the minister's decision . . . We will be responding to express our concern about the process and its outcome and to address inaccuracies in his letter.
"If necessary, we will then consider other options for review of the decision. In the meantime, we will continue to work with the Cabinet Office to ensure that we do what is required to restore our standing with the UK government."
This year an inquiry into South Africa's biggest post-apartheid corruption scandal found that Bain had helped to undermine the country's revenue service through advisory work that aided Zuma's allies.
Bain's work on a restructuring of the South African revenue service was "a clear example of how the private sector colluded" with the breakdown of public institutions, said the inquiry.
It added that Bain sought to use a relationship with Zuma to acquire further government business.
Bain has previously admitted failings in its work in South Africa and repaid fees, but said that the inquiry's findings mischaracterised its activities. Zuma has denied any involvement in corruption.
Other international consulting companies have been embroiled in corruption scandals in South Africa.
McKinsey agreed in 2020 to repay about R650m (NZ$62m) over irregularities in contracts it had entered into with a local partner at government-owned companies.
Auditor KPMG apologised in 2017 for "mistakes" in work for businesses linked to the Gupta family, accused of serious corruption through ties to Zuma.
UK public relations company Bell Pottinger was brought down by its work for the Guptas, which led to accusations that it had stoked racial tensions in South Africa.
Banning a company from bidding for public sector contracts is rare. Security group G4S was temporarily barred in 2013 after overcharging the government for the electronic tagging of criminals, some of whom were dead or still in prison.
Consultancy Deloitte stopped pitching for public work for six months in 2016 after a note was leaked in which its consultants criticised the government's Brexit strategy.