Retirement tax questions

I understand the procedure for all this, but I was wondering why this is not treated as a write off against your current loss rollover balance in a regular stock account? By having to do all this it is basically making it as if it was just in your after tax non retirement trading account all along but instead of it going against the same losses, you are forced to pay taxes on the gains as you would if there was no losses. Do you know why this is or is that just the way it is?

Thank you, just trying to make sure I resolve the situation correctly since I didn't know I couldn't contribute to it last year and now the gains are substantial.

@DanaB27