I know that costs would be different based on region and style as well so for the sake of the question I'll specify castles in France but if someone knows the relative cost of castles in other regions that would be cool to know too. Which castles would be the most expensive, the cheapest?
Check this earlier thread: http://www.reddit.com/r/AskHistorians/comments/1ul3dg/how_much_would_it_have_cost_to_build_an_average/
It's not exactly what you asked for (at least not the top comment) but it is really hard to estimate costs for a castle in dollars. The main problem is that most of the work was done by peasants that payed their taxes by doing work for their lord. You cant really set a price for their labour though.
Edit: Just had the time to read further than the top comment. The second comment gives a more money focused answer and comes to the conclusion that building 10 large castles cost ca. 3 times the annual tax revenue of all of England, the most expensive castle costing about the same as the tax revenue.
This may be a better question for someone in /r/theydidthemath - make sure to go in with a specific castle in mind. Someone there will almost always be able to take into account things of that nature.
Good luck.
The problem with arriving at an answer is twofold.
One, labor was far, far, far cheaper in the middle ages than virtually anywhere in the world today. With the exception of the master masons and perhaps carpenters, most people involved in construction worked for a bare subsistence wage. For an unskilled laborer, it was about half the wage of a common soldier; for a semi-skilled, two-thirds, and that is assuming the laborers aren't fulfilling a manorial obligation and doing it for free.
The other issue is that the economy was far weaker than ours today; exactly how much is really impossible to say. Modern price correlations don't work very well, as the value of things tends to fluctuate with time. Suffice to say, this was a time when most of the population was living hand to mouth on the land, so there was far less actual commerce taking place.
Despite this, a few generalizations can be made. A simple motte and bailey castle - that is, a castle consisting of a wooden palisade surrounding a natural or man-made hill - would be very cheap to build, so long as one had access to a fairly plentiful supply of labor. The resources are easily acquired from the countryside. Anything built of stone is going to be orders of magnitude more expensive. This is because it's also much more difficult to build, requiring the employment of specialist artisans, master masons most notably. It also takes much longer to build; a matter of a few years as opposed to a few weeks. That's more labor that has to be kept on payroll. And, if there's not suitable stone in the neighborhood, it has to be imported, frequently from some distance.
Are you asking "how much money would it cost me today to build a castle structure?"
Or are you asking "how much money did it cost, converted to current US dollars, to build a castle?"
The first one seems easy to do (albeit somewhat tedious) by simply making some reasonable estimates based on current material and labor costs. The second one involves making comparisons across entirely different economic contexts and will be much harder to get any sort of single right 'answer'.
You might find this of interest. A group of historians, students, and volunteers are currently building a castle, using medieval methods, in modern France. An interesting project.