I'm not an expert on the Ruy Lopez, but it seems that its downsides outweigh the upside of potentially creating a doubled pawn on f3.
After 5. h3 Bh5, you are in fact not quite in the same spot: From h5, the light squared bishop can't assist to defend the light squares on the queenside anytime soon, so you can put your pin on the c6-knight to good use.
The weakness of c6 also allows you to easily get rid of the doubled-pawn threat because your queen can relocate with tempo (either by checking on c6, or d8 as soon as the d-file is opened).
For example:
[fen ""]
1. e4 e5
2. Nf3 Nc6
3. Bb5 d6
4. O-O Bg4
5. h3 Bh5
6. c3 Nf6?!
7. d4 {Threatening 8. d5.} a6 (7...exd4 8. cxd4 {Isn't prettier. Now a following Qc2 hits c6 and e4.})
8. Bxc6 bxc6
9. dxe5 dxe5 (
9. Qa4 {Another possibility.} Qd7 (9...Bxf3 10. Qxc6+ {Winning a pawn.})
10. dxe5!? Bxf3 (10...dxe5? 11. Nxe5)
11. exf6 {Hard to assess, maybe this line is a bit too risky.})
10. Qxd8+ Rxd8
11. Nxe5 Nxe4
12. Nxc6 {Looks fine.}
Of course, Black doesn't have to play Nf6, but any other move except 6...Qd7 or 6...a6 (e.g. 6...Be7) won't change anything essential. Black still has to deal with the pin somehow. 6...Qd7 only replaces it with another pin, while 6...a6 still allows the Qa4 manoeuvre. I'd be pretty comfortable with the situation as White.