Seven million people voted against same-sex marriage in the referendum and their votes meant nothing.
President Tsai Ing-wen hailed the vote as a "big step towards true equality" that "made Taiwan a better country".
A court decided in 2017 that same-sex couples had a legal right to marry.
The Taiwan vote comes as gay rights activists around the world mark the International Day against Homophobia, Transphobia and Biphobia.
Judges had given the government until next Friday to pass legislation.
Supporters of same-sex marriage gather outside the parliament building in Taipei.
"Is same-sex marriage that important and urgent?", Liu Yan wrote on Facebook.
The vote allows same-sex couples full legal marriage rights, including in areas such as taxes, insurance and child custody.
Lawmakers pressured by LGBT groups as well as by church organizations opposed to the move approved most of a government-sponsored bill that recognizes same-sex marriages and gives couples numerous tax, insurance and child custody benefits available to male-female married couples.
Taiwan's Constitutional Court in May 2017 said the constitution allows same-sex marriages and gave parliament two years to adjust laws accordingly.
"We need to take responsibility for the referendum past year and we need to take responsibility for people who have suffered from incomplete laws or faced discrimination", ruling party legislator Hsiao Bi-khim said during the three-hour parliament session.
"For the gay communities what matters the most is whether we can legally get married on May 24 and be listed as the spouse in ID cards, to be treated and respected as the "spouse" in the whole legal system. and whether same-sex families can obtain legal parental rights for their children".
The capital city Taipei is home to East Asia's largest gay pride parade - an event that regularly draws tens of thousands of participants. "Just can't wait any longer", Chien Chih-chieh, the alliance's secretary general, said. "They are normal people wanting to build normal relations and the law should include them".
However, a referendum to legalize same-sex marriage was rejected by voters in November.
"Catholicism's definition of marriage is one man, one woman", said Chen Ke, a Catholic pastor in Taiwan and an opponent of same-sex marriage.
"For Singaporeans, this is especially important because our government likes to go on and on about preserving "Asian" values... so this sends a very important message to other developed nations in Asia".
The Coalition for the Happiness of our Next Generation said on Friday that it "regrets and condemns" the parliament's decision, describing it as a "malicious misinterpretation" of the referendum result.