Why does right-sided heart failure causes peripheral edema?

Pressure & gravity. Blood from the legs (and rest of the body as well) returns to the right heart by large veins, goes through the lungs to oxygenate and then into the left heart from where it is pumped to the rest of the body. When the right heart fails there is build up of back pressure on the veins and fluid seeps and accumulates in the dependent areas which is the legs and the gut.