An entire structure's an object; a structure's sections aren't
The general rule is that Very large objects have separate hit point totals for different sections. A castle wall section, for instance, while having separate hit point totals—and possibly even a different hardness value—from the remainder of the castle remains part of the object that is the castle and not a separate object from the rest of the castle.
This means that when a wizard casts the spell continual flame and picks as the spell's target a section of the castle's wall, the GM may rule that the entire castle's exterior is engulfed in heatless, light-producing flame. This will, in the long run, likely annoy rather than please the castle's occupants… not to mention the castle's neighbors. Alternatively, were the caster to pick an interior wall as a target, a generous GM may have the castle's interior flood with heatless fire—likely initially startling most of the castle's occupants but eventually creating a huge demand for sleep masks that should enable the wizard to recoup the 50 gp he spent on ruby dust to cast the continual flame spell and turn a tidy profit.
This assumes, of course, that the player, after proposing this at the table, does not have to go to the hospital after the GM smacks him with the 576-page hardcover Pathfinder Core Rulebook. In other words, I am unfamiliar with any GM actually allowing the spell continual flame to bathe the exterior of an entire castle in heatless flame, nor am I familiar with any GM allowing a spell like darkness to blanket the interior of an entire castle with shadow. While such literal readings are possible—the former more than the latter—, I've never heard of such literal playing occurring: that's just too far outside the scope of such spells for most GMs.
So while it might seem like I'm just no fun, this GM would rule that a spell that targets an object must target a freestanding object that the caster could (not necessarily can right now) carry… and I'd eye the player disdainfully were he to argue, "But if I were the size of planet I could carry the castle!" and hope I'd earned enough good will to have the other players on my side.
Allowing it anyway: some consequences
A GM that nonetheless opts to allow targeting only a section of a very large item like a section of a contiguous ceiling, floor, or wall or the wheel of cart quickly runs into a couple of problems. There's nothing particularly unbalanced about casting the spell the continual flame on a wall section—if that is how you wanna spend thousands of gp illuminating your castle, that's your business—, but the ripple effect such a ruling has on the game's other spells that have the entry Target: Object touched is interesting… in a faux Chinese curse sort of way.
For example, the most troubling and easily acquired of such spells with an entry of Target: Object touched is likely the aforementioned spell darkness and its ilk. A well-prepared foe can already use an effect like darkness as cover from which to slaughter an ill-prepared party. Without the PCs being able to manipulate easily the object on which the spell's been cast (and subsequently destroy it or stuff it into a pouch to break the emanation's line of effect or whatever), PCs are at an even greater disadvantage against the multitude of foes who can employ effects like darkness, be they through actual spells or spell-like abilities.
And an effect like darkness is but one example. Turning the transfiguring touch spell into an ersatz passwall spell probably isn't that big of a deal—I don't think anyone's first must-have go-to spell has been passwall since AD&D 2e—, but sending chunks of the ground the foe's standing on into the air above the foe using the teleport object spell might give a GM pause, and permanently embedding poorly-drawn anatomically improbable illustrations of the king into the king's castle walls by using the trade items spell is, I'm almost certain, not what the spell's designer had in mind. (The king gets a permanent reminder of your visit; you get a souvenir chunk of the castle. Everybody wins!) This is just a random sampling—the crazy actually runs pretty deep.
While these wacky examples might encourage the open-minded GM to rule this way, remember that such results are outside what this reader views as the expected scope of the spells. That is, the game seems to imagine flipping into the midst of your foes a coin onto which has been cast the spell darkness, changing a handheld block of lead into gold using the spell transfiguring touch, sending a foe's artifact sword temporarily to the Ethereal Plane with the spell teleport object, or swapping a taxidermied duck for a foe's helmet using the spell trade items. Using a spell in an unexpected fashion often means the GM makes up what happens, and that could range from the spell failing outright to a result that the caster had not anticipated at all.