As a US citizen, why did Canada stamp my passport at the Montreal?
Because you have entered a foreign country. The stamp is your visa that allows you to be in the country legally. It may even have a date on it saying how long you can stay in Canada legally, just as every one of the stamps I have received from the U.S. Department of Homeland Security do. (There are two in my current passport, both expired).