The use of the word "mason" in this short story is a pun, a play on words. Most of our English words have more than one meaning, allowing a writer to tell us something more about a story and its characters through the use of a pun. In this case, Fortunato is referring to the "Masons", a brotherhood of men to which Fortunato belongs. Montresor's reference to the word "mason" indicates a person who builds using brick and mortar. This foreshadows Montresor's act of entrapping Fortunato within a wall made of brick and mortar. Montresor looks at the trowel within his coat, a tool used to smooth the mortar between the bricks.
When Fortunato asks Montresor if he is a mason, Fortunato is referring to the secret society -- the Masons -- not to a person who literally works with brick and stone for a living. Fortunato is a Mason and he wants to find out (by using the secret sign) if Montresor is too.
Montresor is not a Mason, but he is going to be (later on in the story) a mason. That's why he has the trowel and shows it to Fortunato. He is going to use the mason's tools to kill Fortunato by walling him up. So this is a foreshadowing of what is to come and Montresor is enjoying himself by taunting Fortunato -- he's secretely telling Fortunato "here's how I'm going to kill you."
Some people think that maybe Fortunato kept Montresor from getting into the Masons. They say that might be why (or at least one reason why) Montresor wants to kill him.