"Bad gas" usually just means it has water in it and it will clear out fairly fast, even "old gas" will clear out fairly fast.
Fuel filter would prevent any debris from making it as far as the fuel injectors.
"I have fuel at the rail", 2004 Ranger would have 65psi of fuel pressure at the rail, twice the pressure in one of the tires(32psi), so it would spray out very far when testing pressure at the fuel rail's schrader valve.
Ford computer will run the fuel pump for 2 seconds when key is turned ON.
Do you hear the fuel pump come on, it isn't quiet, very easy to hear it?
If not check the FP Fuse in the engine compartment fuse box, should be 30amp or 40amp.
Old pump may have blown the fuse when first started, so engine died right away, and now new pump won't have power.
You can also spray some Quick Start(ether) into the intake and see if engine fires up and then dies, that would indicate good spark but no fuel coming in.