They are not both “tetrahedral”. Water is planar, but not linear.
Tetrahedral (and the slightly distorted version) is a specific 3-dimensional geometry that applies to many molecules whether all vertices are occupied by an atom or not. Water is not one of them, but is a planar molecule with bent bond angles
Now, the reason for the angles in both (why isn’t ammonia a flat pinwheel?) is that both the N and the O have a lone electron pair(s) repulsing the hydrogens in each case.
A very good, short video (2.5min) of the difference is here, along with the comparison to methane, which is perfectly tetrahedral in geometry.
This video is a little bit longer (9 min) explanation: