It's corruption distilled to its core. The guard (reasonably) gets extra compensation for doing extra duties (detaining immigrants). The guard wants more money, so gives you a cut to detain more people. You start detaining people who you wouldn't ordinarily have to.
However you can't just detain anyone. The games sets specific conditions to let the detain button appear as a choice. So you can't just go and detain everywhere at will.
However, there are cases where the "detain" button appears even though the person is following the rules (the cases I can think of are where the person's name or appearance has changed, but they pass the fingerprint test)
Still you have moral choice to either turn back a person or detain him/her for something minor such as expired or missing permind. And you do the immoral thing becsuse you need money for medicine fo your kid.