Ultimately, what it boils down to is the fact Coronation Street is a family-orientated pre-watershed programme, and not only do advertisers pay a lot of money to advertise during its breaks, but it has a featured advertiser too (Argos, I think). This is why every storyline will have some kind of moral message. They will never show an escort who is entirely happy with their choice to do that line of work, there will always be a degree of negativity and/or shame because anything less could be construed as glamourising this industry.
Nicky wanted to change her life and leave the industry behind her. However, she did not disclose her past to her employers which was a lie on her part. Irregardless of anything, liars are not rewarded, this is something that was a core part of the Hays Code in cinema. Continuing to look at this under the same code, Nicky is a woman, and woman are always punished for their past misdeeds, and sadly, prostitution will always be considered a misdeed, no matter the reasons that lead the person to make that choice. Tbh, the writers in Corrie are simply doing what they have to do to get the storyline on screen which is following guidelines. However, it is worth noting that many of the characters are appalled by the way Nicky has been outed, which is encouraging, and not all seem her escorting past as shameful.
Unfortunately, this storyline is a powerful reminder to us all that if our advertising shows our face and allows us to be identified, then chances are this side of our life can become common knowledge and many will not take kindly to it or be understanding.