There are a few issues.
First, it’s not necessarily going to match up to UV. What you UV does depends on what your UV is. You can map UV to various values if you want. (But doing a 3D spiral is something you want to do in 3D coords, so your best bet is to use object coords and then, if needed, bake to a texture.)
Second, the tutorial you’re using uses a gradient texture to get the “length”, which means it’s clamped in 0 to 1 range. You can see that at the borders of the plane, where it stops working when the distance from the center of the plane gets larger than 1-- it’s drawing a circle on your plane. You don’t have to get the length like this, you can just use plain old fashioned length if you want.
Here’s what I’d do:
You can use either length or Z axis to drive the spiral, or mix the two; you end up with different kinds of spirals, depending in part on your geometry.