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.
Play is very similar to Carcassonne but all the tiles must be played within the walls, which often constrains the choices. The followers used for scoring are heralds (on paths), knights (on towers), squires (on houses) and merchants (on courtyards which are more valuable if they have a market). And, the player with the largest "keep" (largest house completed during the game) scores points for the largest contiguous undeveloped area (unplayed tile spaces) at the end of the game. The bonus tiles collected from the walls add twists to the scoring, such as doubling one of a particular scoring structure or scoring one uncompleted structure.