When proteins are in their funtional state, they each possess unique 3D globular structures so it would be difficult to measure their MW.
First off, SDS PAGE stands for sodium dodecyl sulfate polyacrilamide gel eletrophoresis (can't spell...) The gel part of SDS PAGE are actually composed of many pores, which allow proteins of different sizes to travel at different rate. (Think of this as like a road full of road kills/trash everywhere. If you are a motorcycle it would be easier for you to manuver pass these things therefore travel faster whereas if you are a huge truck, you are doomed to hit something so you will travel slower.)
However, the gel alone cannot work to separate proteins based on MW. Why, because different proteins will have different shapes, so if 2 proteins have similar MW yet different structures, they will migrate at different rates.
This is when SDS comes in handy. Presence of SDS will denature all proteins to primary structures...so essentially with SDS they will all look the same, aka the random coil structure - now you may separate proteins solely based on MW because they all have the same structures.
SDS also adds negative charge to proteins, and this is also important for separation. If the protein was originally uncharged, it will not move at all under electric current. However, because now negative charges are being added due to SDS, protein willl now be able to migrate to anode based on respective MW.
Now, you may wonder, wouldn't the different charges of SDS on protein contribute their migration rate in addition to MW? It does not, because SDS actually binds to proteins on a constant MASS TO CHARGE ratio, so essentially the proteins under SDS will be separated solely based on MW.
hope it helps. This might not be very good, please feel free to ask if got more questions.