This might sound stupid, but I'm unable to see what to do next...
I did the lighthouse and the Den of Thieves, I somehow believe than I need to do the castle but there is a guard blocking the way telling me that I need to go away.
I looked a bit and Maximus seems to give a quest for that but he has nothing for me.
You should have a new quest involving flying to the Elemental forge. To get there, try the previously closed door in the north-eastern area of the 3rd floor in Castle Portmeyron: some guy there will lend you his griffin for a ride. Don't do the same mistake as I did: don't bring the pack horse along, you'll have to dismiss it in order to fly. So, don't buy it before finishing the first part of the elemental quest, at least if you feel like having double inventory space is a must, which is not. Once you'll have cleansed the earth altar, the road will be unlocked and you'll be able to get to Seahaven and die every 5 minutes on the roads like I do. Which is a pleasure.
Have you tried going back to the garrison in town first? It should unlock the castle's dungeon.
If I remember well, things go that way :
Get quest for spider well,
Kill spider queen and while you're here, clear the whole thing to finish side quest (Smugler's cove),
Go back to garrison,
Get quest for lighthouse,
Go back to garrison just to make sure, but I don't think you really have to,
Get quest for Den of thieves,
Go back again,
Get quest for Portmeyron,
Get quest for Elemental forge (part 1),
Cleanse the altar in the lower level and get wiped often,
Same issue. Finished all quests in the area (Rosalie is back to the temple after I killed the first bandit chief): no main quest unfinished. I go to Maximus but he has nothing for me... So stuck...
1. Finished Spider queen > went back to town, talked to everybody
2. Finished Lighthouse > went back to town, talked to everybody
3. Finished Bandit den > went back to town, talked to everybody
4. Castle Portmeyron is locked...