The concept that two distinct populations in close proximity would hate each other is fairly common in the real world. People tend to hate similar groups of people - when it comes to rivalry, familiarity breeds contempt. Ingroup-outgroup bias can be quite strong and grow over time as it becomes embedded in their respective cultures.
If you are talking about just the noblemen hating each other, you can always bring in issues of succession and rights - some from each city claims to be the rightful heir to the other city, and thus should rule both. You could even go a Helen of Troy route and make it about honor and past wrongs.
If you needed a stronger reason than just cultural/ethnic tensions, a resource disparity would engender any number of problems. Each could feel the other city grossly overcharges for whatever resources are traded, while being overly stingy on paying for what is being sold to them, and is capricious about supply. Traded resources may be difficult to produce and supply can fall short of demand, but the other city may not recognize just how difficult/rare it is to produce what is being sold and therefore resents the shortages (other-city people are just being mean and greedy about selling us X, while they are greedy and complain about how we are not giving them enough Y even though we sometimes struggle to make enough just for ourselves).
If the city walls need to encompass enough farmland to support the population, the walls themselves will be fairly small and unmanned (simply a relation between the circumference of the walls to population). It would be fairly easy to send sappers to open large sections of the walls - if the city walls are really only about a kilometer or two apart, one could build a tunnel between them and undermine the walls without ever exposing sappers to the wild - cause a wall collapse during a period of heavy monster presence and let the beasts kill off the opposing city.
Medieval agriculture was not that productive - if they needed to keep all agriculture behind walls, the primary focus would be extending the wall system to include more land. The obvious choice would be to connect their two wall systems - reduces the overall circumference of manned walls against the outside threat. You will need to address why the other city is the greater threat than the beasts forcing them behind walls in the first place.
Honestly it would be difficult justifying why each city would even want to focus on trying to kill the other, instead of being united against the common problem of a constant existential threat to their lives in the form of the beasts trapping them behind walls. That would probably be the biggest reason why they would not go to war - the peasantry would never take up arms against other people when there are much bigger threats, and would likely rebel if the noblemen actually caused the death of the other city. The fight against nature would take overwhelming precedence compared to any rivalry between the nobles.