What constitutes good character is decided by God, of course. But it's a human duty to discern when they're looking at it, and when they're not. And as the passage says, you know what kind of character a person has by what he/she does.
There's a huge misunderstanding that a lot of people have about works. Some say they are salvific...that they are the way one earns heaven. That is wrong. Others say that works do not earn heaven, which is correct; but then they go on to say, therefore works mean nothing at all...and that's also wrong.
Fruit are the evidence of the true nature of the plant. They are not, themselves, that plant's life, but a product of it. They reveal the plant's nature, though, and tell us what kind of life it has.