The employees were suspended following the incident that occurred at a public works yard prior to the Christmas holidays and were fired at noon on Wednesday.
A public works spokeswoman said a third employee had required medical attention for an adverse reaction after "unknowingly" consuming a brownie that contained a substance later determined to be cannabis.
The city said in an email Wednesday that it could not disclose full details of the incident, but that the employees were terminated for possession and/or use of illegal drugs on city property.
Hamilton police investigated the matter and said they would not be laying charges.
Gerry Davis, Hamilton's general manager of public works, said the incident was taken "very seriously."
Hamilton has "zero tolerance for this kind of irresponsible behaviour at the workplace so we have taken the appropriate action," Davis said.