He was elected to Parliament as the Member of Parliament for Christchurch Central in 1996. He has been active in many community-based organisations in New Zealand, including the lesbian, gay and transgender section of the Labour Party, which he helped to found in 1997, and is a supporter of UniQ, the Queer Students Association at New Zealand universities. He was the Parliamentary promoter of the Prostitution Law Reform Bill, a Bill in his name, which became law in 2003 and thus made New Zealand the first country in the world to decriminalise prostitution, and an outspoken supporter of the Civil Union Bill, which became law in 2004 and made New Zealand the first country outside Europe to legislate for equal relationship status for lesbian and gay couples. He was appointed Senior Government Whip after the 2005 election. He was known to be very active in his local electorate chairing a Youth Advisory Committee as well as being a regular contributor to the St Albans Neighbourhood News. At the 2005 general election, Barnett was re-elected with 52.35% of the vote and a majority of 6,694. He retired at the 2008 general election.
After Parliament
Barnett was appointed as the global programmes manager for the World AIDS Campaign in February 2009 and was based in Cape Town, South Africa. In July 2012, Barnett returned to New Zealand and was appointed as general secretary of the Labour Party. In October 2015, Barnett was appointed to the iwi tribal authority of the Ngai Tuhoe as the Group Manager for Iwi based at the Southern Hemispheres largest living building, Te Uru Taumata in Taneatua, Bay of Plenty, New Zealand. In that role Barnett held the portfolio's Health, Housing, Education and Social Well-Being. Barnett resided in the rural township of Ruatoki during that period. In June 2017, Barnett become the CEO of FinCap which is a new nationwide organisation dedicated to serving and strengthening New Zealand's network of financial capability and budget advice agencies. Those local services support people facing urgent and deep financial problems to manage their debts and successfully find ways forward. FinCap has a network of 200 agencies throughout NZ and works with government and NGOs on a range of issues that aims to change of landscape of harm that debt and other associated factors has on the well being of all New Zealanders. To date, Barnett also supports and assist with iwi governance strategic planning as an advisor and a mentor to Members of the New Zealand Parliament.