Two of the purposes for the use of SDS are:
1- The protein samples are treated with SDS because it can break up the shape (2D and 3D structures of proteins) by adding negative charge to the amino acids (removing charge as a factor to the migration of protein in the gel); (desnatures protein and change their charge).
2- The SDS is used in the buffer as a detergent to lyse and solubilize the proteins, making easy for migration in the gel. (make easy to the proteins run on the gel, since it is a detergent with charge that help go to positive end of the gel, taking only into account the mass since the SDS balance the change trait).