The credit rating agency Moody's Investor Service said in a study released Tuesday that legalizing recreational use of marijuana brings governments more money than it costs to regulate it.