The reason “confession” of sin is required, is to free the victim. (D&C 58: 43.) Confession robs the accuser of his power to accuse. (Rev. 12: 10.)
Once the sins of Alma and Younger and the sons of Mosiah were known, confessed and public, the sins no longer had any control over them. They felt no shame for these sins because confessing and admitting they were sinful robbed sin of its power. Similarly, the Apostle Paul’s admission of his sinful past allowed him to move on to accepting and celebrating God’s grace. (1 Tim. 1: 12-16.)
There is power in confessing. It puts the confessor above his sin. (James 5: 16.) We confess to celebrate God’s great deliverance of us. We are all weak. It is part of worshipping Him. (D&C 59: 12.) This is why the testimony of God’s redemption by Alma the Younger included confession of his own sins. (Alma 36: 6, 12-14.)
Those who claim they are holy men, without sin, and thereby cover their weaknesses while courting the praise and admiration of others, have no truth in them. (1 John 1: 8.) But if we confess we are sinful and weak, God is faithful to forgive us. (1 John 1: 9.)
Freedom from sin can only come through admitting your sinful nature. When we confess, He forgives. (D&C 64: 7.)