Teleporting and lagging send the same information to the server. A player is at x1,y1, then they tell the server they have moved to x10,y10.
Is it lag and their PC only just caught up, or did they press R and magically teleported there? Who knows...
The problem is that if you spam teleport enough times, the server can only processes so many packets at once, and it ends up thinking your last position was the position you tried to teleport to. In effect, making the teleport work.
Hence to stop this loophole, you're kicked if you try and do it too many times.