Without a contract in place, most common law says that the program and copyright to the code belong to your friend. Essentially, he employed you for a task and paid for your labor so you were his employee*.
And that implies that you aren't allowed to sell a copy to a second friend since you don't own that application. Your first friend owns it.
However, it also depends upon the verbal (IM'd, or email'd) terms that you guys agreed to when specifying the project. Verbal contracts are a pain to sort out because it's a you-said vs. he-said argument. But if your first friend agrees that you also still "own" the software then you could sell it to your second friend.
In my opinion, the right thing to do would be to give your first friend a cut of the sale. Ideally, he's not asking for all of the sale, but he could be entitled to make the claim. You should also discuss what limits there will be for any additional sales that might occur. Hopefully, you'll come to an amicable agreement.
Legally, there's probably not much that can occur. You're in completely separate jurisdictions, and I'm willing to be that the sums involved are not enough to justify an international lawsuit. Worst case is that you'll have lost a friend, and perhaps with some hard feelings.
Talk it over with your first friend and find an amicable agreement. He does have a basis for his claims.
There is a huge distinction to be made between an application that was created under terms of employment and an application that was commissioned.
If the work was created under terms of employment, an implied contract in this case, then the copyright would belong with your first friend who paid you to write the program. US law recognizes the term "work-for-hire" as an employment term. Canadian law regrettably acknowledges the US term due to the number of Canadian | US contracts, but it's not a preferred term within Canadian contract law.
On the other hand, if the work was created under terms of a commission then full copyright remains with you, the creator of the work.
And there's one more slightly crazy exception to all that. If your friend was requesting the work on behalf of the Canadian Crown then all copyright would belong to the Crown.
The nuances between creation under employment versus creation from a commission are ones that an attorney would have to settle for you. That sort of determination is well outside the scope of what Programmers can offer.
Also off-topic, but slightly interesting, is that photographs and illustrations have a whole gamut of exceptions to the copyright provisions of commissioned work.
For some not-so-casual reading, here are some additional references.