Many mistakenly think that all that is required to dwell with God is asking forgiveness of one’s sins. Forgiveness of sins covers past transgression, but it does not change who you are.
Jesus can temporarily admit us into his presence by forgiving us of our past sins. For example, even Isaiah recoiled from God’s presence until he was told that his sins had been forgiven:
Woe is me! for I am undone; because I am a man of unclean lips, and I dwell in the midst of a people of unclean lips: for mine eyes have seen the King, the Lord of hosts. (Isaiah 6:5)
God’s mercy can forgive you of past sins and make a way for you to learn what you didn’t know, but it can’t magically transform you into a righteous person.
Asking for forgiveness without actually forsaking your sins doesn't change your character. The indescribable pain felt by those with unforgiven sin will return to them as soon as they sin again.
21 And if the Lord shall say—Because of thine iniquities thou shalt be cut off from my presence—he will cause that it shall be so.
22 And wo unto him to whom he shall say this, for it shall be unto him _that will_ do iniquity, and he cannot be saved; therefore, for this cause, that men might be saved, hath repentance been declared. (Helaman 12)
As long as you are the same character that committed those sins, you will commit them again, and as long as you commit them again, you can't be with him.
One who is capable of sin remains capable of sin despite having been forgiven of past sin. An individual capable of sin cannot dwell permanently in the presence of God, because he will soon sin again, causing him to recoil from the presence of God due to the indescribable pain of enduring his presence while in sin.
Those who will continue in sin—even if forgiven of past sin—cannot dwell with God. The Lord makes it clear that those who fail to keep his commandments cannot endure his presence:
Now my son, I would that ye should repent and forsake your sins...for except ye do this ye can in nowise inherit the kingdom of God.... (Alma 39:9)
...inasmuch as ye will not keep the commandments of God ye shall be cut off from his presence. (Alma 38:1)
...the Lord cannot look upon sin with the least degree of allowance. (Alma 45:16)
8 [Those who] obey not the gospel of our Lord Jesus Christ:
9 ...shall be punished with everlasting destruction from the presence of the Lord, and from the glory of his power... (2 Thessalonians 1)
Wherefore, if ye have sought to do wickedly in the days of your probation, then ye are found unclean before the judgment-seat of God; and no unclean thing can dwell with God; wherefore, ye must be cast off forever. (1 Nephi 10:21)
Therefore God gave unto them commandments, after having made known unto them the plan of redemption, that they should not do evil...for on such the plan of redemption could have no power, for the works of justice could not be destroyed, according to the supreme goodness of God. (Alma 12:32)
You have to choose to become the kind of person who is incapable of sin.
27 Have ye walked, keeping yourselves blameless before God? Could ye say, if ye were called to die at this time, within yourselves, that ye have been sufficiently humble? That your garments have been cleansed and made white through the blood of Christ, who will come to redeem his people from their sins?
28 Behold, are ye stripped of pride? I say unto you, if ye are not ye are not prepared to meet God. Behold ye must prepare quickly; for the kingdom of heaven is soon at hand, and such an one hath not eternal life.
29 Behold, I say, is there one among you who is not stripped of envy? I say unto you that such an one is not prepared; and I would that he should prepare quickly, for the hour is close at hand, and he knoweth not when the time shall come; for such an one is not found guiltless.
30 And again I say unto you, is there one among you that doth make a mock of his brother, or that heapeth upon him persecutions?
31 Wo unto such an one, for he is not prepared, and the time is at hand that he must repent or he cannot be saved!
32 Yea, even wo unto all ye workers of iniquity; repent, repent, for the Lord God hath spoken it!
33 Behold, he sendeth an invitation unto all men, for the arms of mercy are extended towards them, and he saith: Repent, and I will receive you.
34 Yea, he saith: Come unto me and ye shall partake of the fruit of the tree of life; yea, ye shall eat and drink of the bread and the waters of life freely;
35 Yea, come unto me and bring forth works of righteousness, and ye shall not be hewn down and cast into the fire—
36 For behold, the time is at hand that whosoever bringeth forth not good fruit, or whosoever doeth not the works of righteousness, the same have cause to wail and mourn. (Alma 5)