UBS was accused of misleading investors about the quality of more than $41 billion of subprime and other risky mortgage loans backing 40 securities offerings in 2006 and 2007, the Department of Justice said.