The Financial Services Authority (FSA) fined the bank for system and control failings within its corporate structure that allowed London rogue trader Kweku Adoboli to cause £1.4bn losses through unauthorised trading.
The FSA originally fined UBS £42.4m but discounted the penalty for early settlement.
At one point, Adoboli had stood to run up losses of £7.5bn for his employer.
The FSA said in a statement: "The systems and controls failings revealed serious weaknesses in the firm's procedures, management systems and internal controls."
In a damning judgment of UBS' internal controls, the FSA said the bank's computerised risk management system was "not effective".
It said Adoboli exploited "significant deficiencies" in the disparate trading system to conceal his unauthorised trades.
The FSA said Adoboli's actions on the Exchange Traded Funds Desk (ETFD) were helped by a culture of support sections working on the principle of efficiency and not risk management.
The Global Synthetic Equities (GSE) division was responsible for managing the ETFD.
The FSA said "the supervision arrangements within GSE were poorly executed and ineffective".
UBS was fined 15% of the revenue of the GSE division by the FSA.
Tracey McDermott, FSA director of enforcement and financial crime, said: "UBS' systems and controls were seriously defective.
"UBS failed to question the increasing revenue of the desk and failed to ensure that there was a corresponding increase in the controls in place over the desk.
"As a result Adoboli, a relatively junior trader, was allowed to take vast and risky market positions, and UBS failed to manage the risks around that properly.
"Failures of this type in firms of the size and standing of UBS not only damage the firms concerned but also wider confidence in the integrity of the markets and the financial system.
"It is imperative that the markets we regulate are seen by investors to be orderly and a safe place to do business."
Last week Adoboli, 32, was found guilty - he admitted to the bad trades, but denied any wrongdoing.
He was sentenced to seven years for one count of fraud and four years for the other, to be served concurrently.
More From Sky News