"just" would be to judge people based on their behaviour and how they treat others, instead of based on what they merely believe.
I think you really have not understood what the Bible teaches. According to the Bible, eternal life is for righteous. It is more than believing something. It is also more than doing some nice acts.
These will go away into eternal punishment, but the righteous into eternal life.
Mat. 25:46
If person is righteous, it will be seen also in his actions, but actions are only a result, not the cause.
He who does righteousness is righteous, even as he is righteous. He who sins is of the devil, for the devil has been sinning from the beginning. To this end the Son of God was revealed, that he might destroy the works of the devil. Whoever is born of God doesn't commit sin, because his seed remains in him; and he can't sin, because he is born of God. In this the children of God are revealed, and the children of the devil. Whoever doesn't do righteousness is not of God, neither is he who doesn't love his brother.
1 John 3:7-10
And it is possible to count one righteous, even if he has not heard of Jesus or God, because:
For as many as have sinned without law will also perish without the law. As many as have sinned under the law will be judged by the law. For it isn't the hearers of the law who are righteous before God, but the doers of the law will be justified (for when Gentiles who don't have the law do by nature the things of the law, these, not having the law, are a law to themselves, in that they show the work of the law written in their hearts, their conscience testifying with them, and their thoughts among themselves accusing or else excusing them) in the day when God will judge the secrets of men, according to my gospel, by Jesus Christ.
Romans 2:12-16
Works are important, but the are only a result of mind. If mind is righteous, the works will also be righteous. More important than works is the mind. If person has righteous mind, then he gets eternal life as a gift. And I believe that is so, because righteous person knows how to live well, truthfully and loves other people.
Also, where's the "love" when he regulates and condones slavery, or orders massive infanticide?
God tells we are not allowed to sell anyone. Buying is allowed and I think it is good, if person obeys all God’s rules. If some nation is so evil that it sells own people, I think it is better, if Jews buy them.
If God kills, I think it is acceptable, because He has given life. He has right to decide how long life He gives and so He is not murderer (murder = unlawful killing). Also, in Biblical point of view this “life” is only short lesson about good and evil that is not even meat to last forever. Soul is the important thing and the death of a body is not the end of soul. If God kills someone’s body, it is possible that the person still lives and is with God. In Biblical point of view, we should not worry about body.
And fear not them which kill the body, but are not able to kill the soul: but rather fear him which is able to destroy both soul and body in hell.
Matt. 10:28
If innocent and righteous person dies, he gets eternal life, according to the Bible. And if person is not righteous, it is better that he doesn’t live eternally.
These will go away into eternal punishment, but the righteous into eternal life.
Mat. 25:46
For the wages of sin is death, but the free gift of God is eternal life in Christ Jesus our Lord.
Romans 6:23