It looks like you're new here. If you want to get involved, click one of these buttons!
You got the "bad" ending because you either did something that is considered evil (like poisoning the food) or your PC didn't defend him/herself at the trial.This is a huge spoiler about what defines what in terms of the ending you get (from the SoD beta forum), by @Illydth :
I did the latter because I was too stupid to realise my paladin-20-rep-only-good-deeds PC would have to, so I got that evil-assassin-cut-throats end, as well.
I didn't have so much problem with Imoen going her own way (definitely do not qualify for the Imoen Fan Club, although I like her in BG1 very much and hate her role in BGII), but I was absolutely shocked by this ending for my super-duper paladin heroine. (I even made a bugreport at BeamDog's Redmine. They changed it to "Feature Request" aka "We won't change this.")
(There exists another ending for PCs that qualified by the game engine for a "good" ending, but I didn't know that until later. And it doesn't soothe me - I still think it's total nonsense if a PC like mine has to list the things she did herself, after Belt just said "Our diviners have presented evidence of your deeds since leaving Baldur's Gate, deeds that speak to your character." - Stupid me.)