These questions are answered actually pretty well on the Wikipedia article for the movie. The thematic analysis is really well written and paints the movie as an allegory for capitalism and big banking preying on the poor.
Without getting into too much of it, I'll address each of the specific questions you mention. The thematic analysis is pretty long to paste the entire thing here but I've included the final paragraph. The short answer is that the movie is meant to be a political allegory.
What was the reason or message behind this incredibly dismal ending?
From the first and last paragraphs of the thematic analysis from wikipedia*
Corbucci, a left-wing radical who made his political views either the
subtext or subject of several of his films, wrote the film’s story as
an allegory highlighting the corruptions that can be caused by
capitalism and authoritarianism, which are personified by the
sadistic, greedy bounty killers led by Loco (who use the bounties to
fuel their desires for violence and money while acting under the law),
as well as the schemes of the banker Pollicutt.
The deaths of Silence, Pauline and the outlaws at the hands of Loco
and his gang are a culmination of the subversive elements of The Great
Silence and its anti-authoritarian stance. The deaths of sympathetic
characters were nothing new for Corbucci – he had previously allowed
the title character of his first Western, Minnesota Clay, to be killed
off. However, the political context of his later film made plays a
major factor in the presentation of its thematic concerns. According
to Alex Cox, a major proponent of Corbucci’s films, “Corbucci’s widow,
Nori, told [producer] Katsumi Ishikuma that her husband had the deaths
of Che Guevera and Malcom X in mind when he conceived The Great
Silence... For the radical, for the revolutionary, both deaths were
terrible news. You could only take on the powerful and the wicked for
a short while, it seemed, before they crushed you.” In contrast to the
deaths of leading characters in similarly progressive films of the
time, such of Ben, Duane Jones’ character in Night of the Living Dead,
and Dennis Hopper and Peter Fonda in Easy Rider, in which said
characters are killed by similarly disenfranchised groups, the bounty
killers are working as part of the State, acting in the service of
capital by helping to protect it. What further separates the deaths of
the heroes and the anti-authoritarian position of The Great Silence
from Romero and Hopper’s films is that, unlike Night of the Living
Dead and Easy Rider, which were produced without the restrictions of
well-established genre conventions, Corbucci’s film also subverts and
comments on the genre that it is part of. Cox believes that the moral
message of the film is that "sometimes, even though you know you'll
fail, you still do the right thing." He also adds that by facing an
unbeatable foe and dying in the ensuring duel, Silence "becomes the
noblest hero of any Western film since Shane."
And was this changed at some point and are there (maybe even released) alternative endings or was this always the intended ending?
There was an alternate ending filmed that Corbucci was apparently forced to make by the studio in order to show the film in certain markets, but the bleak ending was the original ending and the one Corbucci intended.
From wikipedia article on alternate ending
Due to the bleak nature of the original finale, Corbucci was forced to
shoot an alternative "happy" ending to the film for the North African
market, where Spaghetti Westerns were popular, but had to have an
upbeat conclusion. Some of the footage shot for this ending appeared
in the film's Italian trailer, despite it not appearing in that
release of the film. Because it was believed that no audio elements
for this ending had survived, early DVD releases of the film, such as
the US release from Fantoma Films, feature it without sound. However,
a version with Italian dubbing has surfaced in recent years, and has
been translated into English by members of the Spaghetti Western
In this ending, Loco draws his gun without waiting to be prompted by
Silence. Suddenly, Burnett, having somehow survived being trapped
under the frozen lake, rides into town on horseback and shoots Loco in
the head, giving Silence enough time to kill the remaining bounty
killers. Burnett frees the outlaws as Pauline takes the bandages on
Silence's burnt right hand off, revealing a gauntlet that he used for
protection. As Burnett takes the thieves to the local jail to await
their amnesty, he asks Silence to become his deputy, which he accepts
with a smile. Reunited as a romantic couple, Silence and Pauline see
Burnett and the outlaws off.