Facebook has apologized for a policy that drew criticism from LGBT groups after it led to the deactivation of dozens of accounts.