We do not gain salvation because we are free of sin. Jesus being sinless meant he could not be left dead when he was killed. His sacrifice was that of a perfect man and so by freely giving up that life as a perfect man on earth he then opens a way for us to gain salvation.
Our sinful state is not an excuse, We can still recognise good and evil and strive to fight against our sinful state. Without Jesus sacrifice we only had the judgement of death on us. But Jesus's sacrifice allows us to gain life.
Romans 2:11-13 (New International Version)
11 For God does not show favoritism.
12 All who sin apart from the law will also perish apart from the law, and all who sin under the law will be judged by the law. 13 For it is not those who hear the law who are righteous in God's sight, but it is those who obey the law who will be declared righteous.