The Israeli military has been accused of staging a photograph published to celebrate its progressive attitude to homosexuality.

The image, of two male soldiers holding hands while walking down a street in uniform, was posted on the Israel Defence Forces' Facebook page to coincide with gay pride events in Tel Aviv.

The caption read: "It's pride month. Did you know that the IDF treats all of its soldiers equally? Let's see how many shares you can get for this photo."

By noon on Wednesday it had been "liked" almost 10,000 times and had attracted more than 1,400 comments.

But the Times of Israel news website claimed the photograph was misleading, saying: "The two soldiers in the photo are not a couple, only one of the two is gay, and both the soldiers serve in the IDF spokesperson's office."

A spokesman for the IDF refused to answer a direct question on whether the photograph had been staged, saying it was irrelevant to the military's attitudes to homosexuality.

"The photo reflects the IDF's open-minded attitude towards soldiers of all sexual orientations," it said in a statement. "The IDF respects the privacy of the soldiers featured [in] the photograph, and will not comment on their identities."

The IDF prides itself on its integration of gay, lesbian, bisexual and transgender soldiers, which it says "stands out in comparison to other militaries worldwide".

According to its website, "the IDF is an accepting environment for homosexual soldiers. The IDF has made groundbreaking progress over time, but it is still trying to improve military service of gay soldiers even further."

The US repealed its ban on openly gay and lesbian service personnel last September. Its previous policy, known as "don't ask, don't tell", had forced gay and lesbian soldiers to "lie about who they are", said the president, Barack Obama. There are an estimated 65,000 gay and lesbian service personnel in the US military.

The ban on gay and lesbian people serving in the British military was lifted in 1999.

Some Israeli activists have accused their government of "pinkwashing" – presenting Israel as enlightened because of its gay-friendly attitudes while denying human rights to Palestinians.