Lam, making her first policy address since she came to power earlier this year, skirted the subject of political reform as the city's pro-democracy forces contend with an increasingly assertive Beijing.
She began her speech with a reference to the Chinese president's warning that any challenge to Beijing's control over semi-autonomous Hong Kong crossed a "red line" when he visited the city to mark 20 years since the handover in July.
"President Xi Jinping said in all earnestness that the destiny of Hong Kong has always been intricately bound with the motherland," said Lam after her opening remarks.
"Everybody with a passion for Hong Kong has...the obligation to say 'no' to any attempt to threaten our country's sovereignty, security and development interests," Lam said.
She added the city has "the duty to nurture our next generation into citizens with a sense of national identity", referring to proposals to imbue the youth with a sense of Chinese patriotism.
The failure of the democracy movement to win concessions has led some young campaigners to call for self-determination or even full independence for Hong Kong, which has infuriated Beijing and local authorities.
'Government has no magic wands'
Dodging the heated issue of political reform, the Beijing-backed leader turned to Hong Kong's acute housing shortage and described solutions to it as fundamental for social harmony and stability.
She said "meeting the public's housing needs is our top priority", but added "the government has no magic wands".
Skyrocketing property prices have been fuelled by an influx of money from wealthy mainland Chinese investors and developers.
Lam introduced a plan to roll out subsidised homes for Hong Kong's middle-class at a time when the city's wealth gap was recorded at its highest point in nearly 50 years.
Dozens of demonstrators gathered outside the legislature, protesting over pension funds as they hit gongs and drums adorned with top officials' faces.
Protesters also condemned the jailing of leading activists and the disqualification of pro-democracy lawmakers over the summer, in a string of cases critics have slammed as political persecution.
The 60-year-old career civil servant Lam, who was selected this year by a mainly pro-China committee representing special interest groups from real estate to agriculture as well as lawmakers, became Hong Kong's first female leader in July.