Massachusetts officials thought they were close to securing future supplies of green energy by piping in hydroelectric power from Canada.

But a week after Massachusetts said yes to the $1.6 billion project, neighboring New Hampshire said no, jeopardizing the 192-mile transmission line that would bring in the electricity through the Granite State.

The...