How come pvc water pipe cannot be used to run electrical wires in the ground? The water pipe is in the ground and the only difference is that water runs through it, not electricity. Maybe I'm missing something here. It will be covered up.
Because it's a code violation to do that, anywhere that standard electrical codes apply. Water pipe is tested, listed and approved for carrying water. Electrical conduit is tested, listed and approved for protecting wires. Different things matter for those different applications.
It can be very expensive to replace it with the proper material if an inspector finds it. It will void your insurance if it's involved in any future failure, and if you sell the place it will be a concealed defect that will cause the new owner or their insurance company to come after you or your heirs for the damages when it's discovered.
While it's not the method we usually recommend, based on experience, you can choose a code-compliant direct burial type of cable and then you only need a little bit of conduit to protect the cable at the ends of the run. It needs to be buried 24" to the top of the cable in that case. And you hope nothing ever damages it, since then you have to dig the trench again (which is one reason conduit is preferred - more protection in the first place, and no need to dig the trench a second time if there ever is a problem.)
You can use plumbing pipe for an underground run if the purpose is to provide a runner (e.g. between home and shed) and protect NMWU wire.
It's possible that some inspectors object, especially if the pipe forms an air channel between spaces that should be fire blocked. Should this be the case with your shed, you can overcome this by ensuring that the runner pipe terminates before the shed, not in the shed.
You have to make sure that the pipe does not damage the wire if you are pulling. Since you will be required to use NMWU, the run does not have to be water tight.
If you are using electrically rated conduit you can use THWN.
Because the fittings are different
PVC DWV or water piping and PVC conduit use different fittings in at least some cases. As examples, the sweeps used with conduit are much wider than a typical plumbing elbow or even a DWV sweep, and plumbing has no equivalents to conduit bodies, box adapters, or even a bell end fitting as used in some communications applications.