I agree with previous responses regarding that NONE are righteous on their own, only by trust in God's promises (pre-Christ) and in Jesus Himself.
The specific context of Deuteronomy 1 is really important here, I think: the sin preventing the Israelites from entering the Promised Land here is that they gave in to the fear of the Canaanites and some of them made plans to turn back toward Egypt, while others went in to fight the Amorites against God's command.
This was direct rejection of God's gift and complete mistrust in God's goodness, providence, and power to deliver them into the land he had promised to Abraham. In this sense, the children not knowing good from bad doesn't make them innocent, but rather that God is specifying that He would still bring the Israelites into the Canaan - only not the generation that had refused to enter it.
In other words, the children were not considered to be culpably involved in this particular sin - the rejection of entering the Promised Land - but Got was still dedicated to fulfilling His promise to his people. Therefore, the consequences of that rejection would only be carried out on the current generation, while the promise would be granted to the next. This doesn't mean that the children were innocent per se, but rather that they hadn't disqualified themselves from entering the Promised Land.
In the case of Sodom and Gomorah, the rampant wickedness and sin of the cities had penetrated all levels of the society. As in the exchange of Genesis 18:23-32, God did not find a single person in the cities to be righteous. Indeed, no human is truly righteous on our own.
The destruction of the cities was a consequence of deep sin that applied to everyone, and a display of God's hatred toward sin, while denial of entering the Promised Land was a logical consequence that applied only to the generation of Israel that had refused to enter it on God's terms (not including Caleb and Joshua, who had acted and spoke in faith upon spying out the land).