I mean, I mentioned this in a rant the other day, but sufficiently available and powerful teleportation just completely changes the game of war. I'm no tactical genius, and even I can tell that if enemies can just ignore the fact that you've got walls at all, your walls are not very useful- not to mention potential implications on logistics (and implicitly trade), if you can teleport goods.
The easy answer to this, of course, is to make it so that teleportation is either unavailable, or restricted in some important way. Harry Potter and Schlock Mercenary, amusingly enough, get around it through the same basic method- You can't teleport into or out of an area with an anti-teleportation field set up. This could justify a sort of 'Castle Wizard', tasked with maintaining the fortification's wards against intrusion.
Alternatively, make it so that teleportation is only possible through specifically created teleportation circles connected to a network of similar circles, and make these circles expensive and hard or impossible to transport, and then set up your fortifications so that anyone coming in through the circles would have to pass through security to get in anyway.