More specifically - were castles built in conquered territories because of realist necessity, or because the opening-up of those places led to over-investment and unwise speculation?
I can't speak to the Baltics and Holy Land, but in Ireland and England it would have been more out of necessity. The three occurrences that jump out at me are the Norman invasion, King John's conquest of Ireland, and Edward I's invasion of Wales. All three of these are complicated by specific political concerns. But I can generalize the situations a little bit.
In each case it's a 'foreign' invader gaining power over a specific region. If you've just conquered a region there are a couple of immediate concerns. First, you're going to want to protect your land gains. How do you go about doing that? Build a castle. You're also going to have to have some sort of administrative headquarters in the region. Where do you put it? Well... the castle (and in some cases fortified town) provides an ideal location, it's central, protected, and under your control. The third element would be like a show of force. Especially in the case of Edward I in Wales where he begins building castles before his conquest is even complete. He poured a ton of money into building not just large and imposing castles, but also building them quickly.
Castles in the context of foreign subjugation are far more practical in purpose than in other contexts where they take on a more residential need in other situations. They served as military and administrative headquarters while also impressing on the local populace a change in rulership. These things would be shown in other ways as well. The Normans went through a great deal of effort to remove Anglo-Saxon buildings in England and replace them with their own, a sort of symbolic changing of the guard. Going back to Wales, it's widely believe that Edward I actually took materials from the ancestral home of the ruling Princes to build his castle at Beaumaris.
I'm not too sure about the amount of investment in conquered territories occurred. In Britain these trade routes already existed and many lords held lands in both France and England or England and Wales. If other lords are building castles in conquered lands I would think it's more for the reasons I listed above, which in turn would lead to financial gain.
They weren't so much speculation, more along the lines of hostile takeovers.