Carcassonne: the Castle takes place in the city of Carcassone itself. The theme is development of the city within the "castle walls", which might be more appropriately called the city walls, but Carcassonne: The City was apparently already in development.
It is not an expansion, but a stand-alone tile-placement game with the Carcassonne mechanics adapted specially for two players. The goal is to lead the race around the castle wall, which is also the scoring track for the game. There are bonus items on the wall for the first player to reach that point.