The Castle gate give a bonus to the defense of the front of your Castle. Every time you upgrade the gate, gate protection is increased by 20%. When you begin, you start with a Level 1 gate.
Increasing Gate Defense Bonus
You can further boost your Gate Defense Bonus in two ways:
1) Review your Castellan's equipment ie: helmet, artifact,armour and weapon and swap them out for any items that have 'increase gate protection by....etc'. This is a useful thing to do anyway once you've captured an outpost as items that were goo d for attack ie: 'occupation time decreased' are now pointless if your castellan is now going to defend the OP.
The picture below has the mouse hovering over the castellan and you can read +10% gate protection plus all his other attributes. (He has a weapon that gives him 5% gate protection and armour giving him another 5% gp). This outpost has a Level 3 gate giving a gate defense bonus of 60% (see table above) and adding the castellan's equipment you can see the total gate defense bonus is 70%.
You can boost equipment further by visiting Technicus when he drops by and upgrading whatever it is you want to boost (gate, walls, speed etc) to increase the %.
2) Buy a portcullis from the Armourer when he visits (rubies) or grab them when they come up as nobility prizes or from the Mercenary Post. Portcullis adds 75% gate protection when you add this item to a castle gate slot. It does not matter how many portcullis's you add on a single gate slot - the bonus for this tool is still 75% - but as they get destroyed with each WAVE of an attack it's sensible to buy a few at a time.
If you have more than one castle gate slot (from Level 24) add mattresses to the other gate slot. Mattresses add 60% and, as the portcullis, it doesn't matter how many you add - it will always be +60% .
The pic below shows the gate on a Level 37 player OP with a level 3 gate at 205% . Here's the sum: 60% Gate Defense Bonus (Level 3 gate) + 10% from the Castellan's equipment = 70% + 75% for portcullis = 145% + 60% for mattress = 205%