Judges said the government had breached the rights of three gay couples by refusing them marriage or any other recognised form of union.
Italy is the only major Western European country with no civil partnerships or gay marriage.
Prime Minister Matteo Renzi has long promised to pass a law on civil unions.
By failing to introduce new legislation, his government failed to "provide for the core needs relevant to a couple in a stable committed relationship," the European Court of Human Rights (ECHR) ruled on Tuesday.
The court said Italy was in breach of Article 8 - the right to respect for private and family life - of the European Convention on Human Rights.
A small number of municipalities in Italy allow local civil unions, but there is a national ban on same-sex marriage and the benefits of the existing provision are limited.
The court said the existing legal protection was "not sufficiently reliable".
It noted that 24 out of the 47 member states of the Council of Europe had passed laws in favour of legal recognition, and that the Italian constitutional court had repeatedly called for such protection and recognition.
The three couples in the case have been together for years, and all had their requests to be married rejected.
The ECHR ruled that the Italian government should pay the six men â‚¬5,000 (Â£3,500; $5,500) each in compensation, as well as expenses.
The prime minister has said his government would introduce laws on same-sex civil unions this year.
Hundreds of thousands of people marched in Rome in June against the proposed legislation.
But opinion polls show an increase in support for gay marriage.
It follows a pattern seen in Ireland - a strongly Catholic country like Italy - where voters overwhelmingly backed legalising same-sex marriages in May.
Afterwards, a senior Vatican official said Ireland's referendum result was a "defeat for humanity".
Italy violates human rights by failing to offer enough legal protection for same-sex couples, a European court has ruled.