So, I made an enderman farm in my survival world. It worked great, I was able to get a lot of xp and pearls, but when I tried to leave, enderman would spawn on the "unspawnable" oak leaves i had behind the contraption. Did I do something wrong, or is that just the game?
but they still can teleport there, if it is happening only if you leaving, they could spawn anywhere else and just teleport there. (Probably, I don't see your map) - my enderman farm is filled with water, but places I want to go is 2,5 block tall, so they can't teleport anywhere
Leaf blocks are not considered unspawnable by the game...something (ocelots, parrots) somewhere (only in jungles) can spawn on them, so even outside of those conditions the game still allows spawn attempts to land on leaves. From there, the game travels randomly for 5 steps taxicab to obtain a new spawn location and because of changes in 1.13 to how this works this means that all spawns will only ever travel to surrounding leaf blocks or the spawning-platform blocks.
The net result is that the game thinks your farm is much bigger than it actually is.