According to the accounts of those at the execution of Hale, he didn't say these exact words. They were contained in the memoirs of General William Hull (1848), a close friend of Hale's. Hull was not at the execution but he based his report on the recollection of a British officer who was.
Another British officer at the hanging wrote this in his diary: "He behaved with great composure and resolution, saying he thought it the duty of every good Officer to obey any orders given him by his Commander-In-Chief; and desired the spectators to be at all times prepared to meet death in whatever shape it may appear."
The playwright Joseph Addison, in his 1713 play Cato, included the line, "what a pity is it/That we can die but once to serve our country." It is known that Addison was a favorite of Hale's.
Source: [/i]Nice Guys Finish Seventh by Ralph Keyes.