How do you eliminate the gap between castle doors?
I'm assuming that you are referring to this door:



These doors are designed for the hinge to attach from the back of the door and not the side, which might be what is tripping you up. There are ways to get these to line up with the hinge on the side, but the easiest fix is to just have them hinge from the back.

This part is used in many sets including 7036-1 Dwarves' Mine. Here's an example of this part in use from the instructions for that set: