Edges don't "stick" to Object in Edit Mode
This is because you are using a surface object, and this is the way surface objects behave. If you want the edges to "stick to the torus" as you say, you will need to convert to mesh (press alt-c and select the second option). You could also simply initially add a mesh torus and use that.