That's a pretty scary abuse of power. By Canada. Diverting the plane to Canada was okay, because the U.S. has jurisdiction over what air traffic may enter its airspace. However, the Canadian government had no legitimate legal right to arrest any person so diverted, because as a passenger on an international flight, he did not legally enter Canada, and a landing forced by the inability to reach your destination due to circumstances beyond the pilot's control constitutes an emergency landing, which is subject to various legal protections in all civilized countries.
Unfortunately, I've read that the Canadian government did a lot of that sort of thing for international passengers diverted on 9/11, too. Apparently Canada has little respect for international law regarding air travel—specifically, Articles 5 and 25 of the Chicago Convention (of which Canada was originally a signatory, but later withdrew from).
What the U.S. did was rather bizarre, but legal. What Canada did was unconscionable. Want to ensure that this never happens again? Write your MPs and demand that Canada re-sign the International Air Services Transit Agreement (IASTA).