Goldman Sachs, which emerged relatively unscathed from the financial crisis, was accused of securities fraud in a civil suit filed Friday by the Securities and Exchange Commission, which claims the bank created and sold a mortgage investment that was secretly devised to fail.