Q is an enigma because for the most part he seems to act like Loki
, basically an amoral trickster who is just doing stuff for his own amusement. But at times he gets on a soap-box and berates humanity for not living up to some moral ideal (starting with Farpoint). A moral ideal that he himself doesn't seem to meet. So it's really hard to pin down what he stands for. But this ambiguity is the key to the character. He's supposed to frustrate all attempts to categorize him as "good guy" or "bad guy".