I'm pretty sure Goldman isn't a rating agency.
Goldman and Paulson had an opinion about the mortgages. Neither is always correct. They created a synthetic security. Showed the potential buyer the pieces that the security derived its value from and said, would you be interested in buying some? They weren't selling to unsophisticated investors, they were selling to other huge entities who could do their own research on the mortgages
They were buying AAA ratings from Moody’s et. al.