Q:

What is Montana worth?

I came across an interesting article that points to a change.org petition suggesting that the United States sell the state of Montana to Canada for one trillion dollars ($1,000,000,000,000) and put that directly towards the nation's debt.
I don't think the petition is serious and has less then a nothing percent chance of happening, I think, but it raises a very interesting question. When one nation wishes to sell territory to another nation, how is that value determined? 
I'm aware of instances where territory was ceded through treaty, as a means of making or keeping peace. That's not what I'm thinking about. I'm think of things like the Louisiana Purchase, where the USA paid France for most of what is the Continental US today as a simple transaction. France wanted money and the USA wanted the territory. 
How are the costs of these things usually determined? It might be useful to look at how the price for the Louisiana Purchase was determined, as a real example that did occur. Then using the same thought process, what would Montana cost if it really was sold to Canada? Other examples might help, especially if they are more recent than the Louisiana Purchase.

A:

In theory this would work much like any other land transaction. The two parties would carefully evaluate what they think the land is worth, taking into account things like natural resources. Based on their respective calculations, they would then negotiate.
But when it comes national territory, yes, that makes things different. I'm not sure there is actually any good historical analogy to draw from in imagining how such a transaction would work in the modern world.

I'm think of things like the Louisiana Purchase, where the USA paid France for most of what is the Continental US today as a simple transaction. France wanted money and the USA wanted the territory. 

Not exactly. What the US effectively bought was the rights to tax and colonize. Neither party had much of a clue as to what they were buying/selling when it came to the value of the territory itself. The French had barely explored it and they still had to deal with the natives who claimed that land. Even the very concept of national territory was still emerging at that point in history.  
The US didn't plan to buy all that territory, they basically just wanted New Orleans. The US delegates were surprised that the French suddenly offered the rest of their territory at an almost nominal price. But in retrospect that it makes sense that without New Orleans, the rest of the territory might have been more of a burden then anything.
Much the same was true of the Alaska Purchase. Russia wanted to continue in the fur trade, but they didn't want to bear the cost of military protection. By selling the US the right to colonize, they were hoping to keep the British off their back.

A:

Montana has a GDP of $34 billion, as about 1/4 of GDP is collected as tax, Montana provides about $8.5 billion to the government.
Assuming you would want an investment to pay about 5% per year a corporate state might be willing to pay about 170 billion for the right to tax the people of Montana.
This is naturally a very simplistic model but it puts the ballpark figure for how much a region might be "worth". If a sale were desired then it would be a matter for negotiation and agreement.
But the USA and Canada are not corporate states. They are constitutional democracies and countries. Countries in the modern world don't do business like this.  There is no constitutional method by which the USA could "sell" a state. It is pretty certain to be unconstitutional. So it couldn't happen. 

A:

Other examples might help, especially if they are more recent than the Louisiana Purchase.

Wikipedia has a list of United States territorial acquisitions, which includes the following paid ones:  

Louisiana Purchase:  "$15 million (equivalent to $251 million in present-day terms)."
Mexican Cession:  "$15 million (equivalent to $403 million in present-day terms) and agreed to pay claims made by American citizens against Mexico which amounted to more than $3 million (equivalent to $81 million today)."
Gadsden Purchase:  "$10 million (equivalent to $301 million in present-day terms)".
Alaska:  "$7.2 million (2 cents per acre) on March 30, 1867 (equivalent to $129 million in present-day terms)".
Spanish colonies (Puerto Rico, Guam, Philippines):  "$20 million, equivalent to $602 million in present-day terms".

The most expensive was the most recent.  That included the Philippines, which are no longer considered US territory.  That also ended the Spanish-American War, so the money may have been for more than just the transferred territory.  
The Gadsden Purchase was one of the two smallest.  
Three of the acquisitions were larger than Montana.  The most expensive was less than a billion dollars even in modern terms.  From a historical basis, none of them have a territorial value that is even a thousandth of a trillion.  
Beyond all this, Montana seems not the best choice.  Alaska is contiguous with Canada but not any other US states.  But Montana and Alaska both voted for the less Canadian-like politician.  Their populations would not fit Canada.  
Some places that vote for Democrats, who are more like Canadian politicians, include 

Maine.
New Hampshire.
Vermont.
Massachusetts.
Rhode Island.
Connecticut.

Some cities that are relatively close to the Canadian border (or to the New England border):  

New York City.
Buffalo.
Detroit.
Seattle.

If we add New Jersey (connected to New York City), that would also allow 

Northern Delaware.
Philadelphia.
Baltimore.
Washington, DC.  

Puerto Rico could go with them as well.  
That population is much more consistent with Canada in their political views.  Such a swap would give them a government more in line with their views.  
This would be less land than Montana, but more people and economic activity.  Something like 35 million population.  Perhaps $2.5 trillion GDP.  
More importantly than a simple money transfer, presumably Canada would pick up the obligations.  Such obligations would include a couple trillion in debt but also trillions more in Social Security and Medicare obligations.  
But as already mentioned, this wouldn't really work as a sale.  It would make more sense as an independence vote.  

