There's probably someone with more qualifications to answer this but I think it's fairly obvious that it was both. The stories were supposed to be tragedies. Tragedies exploring bad events happening to or caused by the characters, and comedies meaning happy endings.
Greek heroes encompass, generally, the idealized Greek but are almost always given a fatal flaw of some kind. There were definitely moral messages, as well as political messages in the plays. Heracles is a good example, when he went insane (due to Hera) and killed his family you can feel pity for him but as the Greeks saw it he was still guilty and had to atone for it. So yeah someone like Bellerophon can be a hero and you can sympathize with his death via Hubris, but at the end of the day he still committed hubris because of his arrogance. He got what he deserved but you can still feel bad about it and say "oh if only he hadn't presumed to be on par with the Gods" The thing to remember is that humans haven't changed fundamentally since then so they'd definitely be feeling the same emotional attachment to characters and events as we would today whether it was intentionally written into the play or not.
Perseus is a pretty unusual subversion of the fatal flaw trope too which is kind of neat.
As other people have said, its both yes and no, and will depend on the play that you look at.
For example, if you look at an example of Oedipus the King by Sophocles, you can see a character who is portrayed as a good person whose downfall is brought about by a series of understandable mistakes, or hamartia. Compare this to something like Women of Trachis also by Sophocles where Heracles is depicted as a horrible person, and a monster.
It is also important to note the “hamartia”, while often translated as a “fatal flaw”, is more a mistake that is made by the tragic figure. For example, in Oedipus the King, he is led to believe that he is avoiding the prophecy, but unknowingly fulfils it without knowing. Or in The Bacchae written by Euripides, Pentheus is mislead by Dionysus who is in disguise. In this way, you can see how Greek tragedy evokes pity- as it is a mistake that anybody could make that leads to the downfall of the tragic figure.
When looking at this topic, Aristotle’s Poetics is a good place to find some insight on how the Ancient Greeks would have viewed the topic.
A tragedy, then, is the imitation of an action that is serious and also, as having magnitude, complete in itself, in language with pleasurable accessories… with incidents arousing pity and fear, wherewith to accomplish its catharsis of such emotions. (Aristotle, Poetics 1449b)
From this it can be taken that there is the element of both pity and fear, especially with the use of the Greek word “katharsis” (or catharsis) which was used which implies an aspect of the audience experiencing the emotion. However, the "fear" was less of a "they got what they deserved", and more of a "oh no, I should not make this mistake", as the concept of a hamartia is based on an understandable mistake.
Overall, while difficult to truly understand the mindset of the Greeks, there is certainly the aspect of both the moralising and the pity which Greek tragedy evokes.