In 19:37, after the destruction of S'dom and the surrounding cities, the daughters of Lot decided they were the only survivors and they had to repopulate the world. The problem was the only man left alive was Lot, their father. That makes the relationship incestuous and forbidden. There were not other choices, so they went ahead, got him drunk and got themselves pregnant.
The older daughter named her child Moav, because he was born from her father. The younger daughter named her child Ben Ami.
Rashi says the older daughter was immodest in announcing to the world what she had done and therefore that is why later the Jews are told they can wage battle with Moav. The younger daughter was more modest by hiding the source, and that is why later the Jews are commanded to not fight with Amon.
We see from this story that sometimes you might be in a bind. You might be in a situation in which you have to do something unpleasant and wrong. But you might do it because you have no other choice.
So you do it. You don't have to be proud of it though. Keep it quiet. Keep it private. Don't announce your shameful act, that might even have been justified at the time, to the world.
Use a little discretion.