Recently one of my friends opened an account with a Reputed online trading website. After couple of days his account was deactivated and was asked to provide a copy of his SS card. Is it legal for them to ask for it?. Is it safe for him to give them a copy of his Social Security card?

Uh, no. It is not worth the risk. Cut your losses off now (him) and I would be watching my credit report. It may or may not be a scam. My guess is yes, it is a scam. Check http://www.badbusinessreport.com and the BBB.org and see how “reputable” this company actually is.
Yes its legal. If his SS number came up invalid or with a different name it is even required by law that they verify his identity. And yes it is probably as safe as giving it to anyone else.
got to have it to file capital gain/loss tax