Catalysis of the reaction: NADP+ + sn-glycerol 1-phosphate = dihydroxyacetone phosphate + H+ + NADPH.