Well, Vicky it makes me wonder how you got the 2x4 OUT in the first place! If the faucet was attached with screws on the front side, how did you remove it?
If the "faucet" is a shower mixer, it would look like the picture below. The only way to anchor it would be to use a 3" threaded rod. Drill thru the 2x4 so you can slip the rod thru it and thru the clip that holds the supply pipe in place. Do a 5/8" counter sink on the 2x4s back side (use a paddle bit so you get a flat bottom). Slip the clip over the supply pipe. Hold a nut and washer on the other side and screw the rod into the nut. Do this for all four positions. On the backside of the 2x4, screw on washer and nut combinations to hold it in place. Tighten as best you can. If the rod extends past the wall surface, use an angle grinder to cut it off.