PORTLAND — A Superior Court judge has thrown out a homeowners’ association vote to allow a condominium project with rooms that could be rented like a hotel on Great Diamond Island.

Justice John C. Nivison, sitting on the Business Court, said the vote had a number of flaws, including a discrepancy between the number of votes and the number of proxies, two votes counted for one unit and votes that were submitted in forms that were in violation of the by-laws of the Diamond Cove Homeowners Association.

The association narrowly approved The Inn at Diamond Cove, which was to be built in the former barracks and hospital at Fort McKinley on the island, in a June 2007 vote. Many of the other former fort buildings have been converted into homes or condominiums.

City boards had approved the inn, but the association had to change its rules barring hotels.

The project was going to have a number of condominium units in which the bedrooms could be locked off from the rest of the unit. That would have allowed the inn to rent out up to 60 rooms on a nightly basis said Tim Norton, the attorney for The Friends of Great Diamond Island, which had challenged the association’s vote.

Norton represented homeowners who opposed the idea of a hotel in their neighborhood.

Norton said the decision to invalidate the amendment also eliminated a clause that had exempted the city of Portland from paying association dues. He said the city acquired 23 units for unpaid taxes and had not paid dues, but cast votes on the amendment to the rules.

Norton said the unpaid dues total $800,000 to $1 million.