justify (something) by (doing something)
To attempt to prove that something is just, right, or valid by saying, asking, or explaining something. In passive constructions, a noun or pronoun is used instead of a gerund. When I confronted him about transferring the money into his personal bank account, he justified it by saying that the company would be able to dodge a lot of taxes that way. She justified her actions by explaining that the needs of the many outweighed the needs of the few. I know my policies have been controversial, but they have been justified by their results!
justify something by something
to try to explain why something needs doing or why it is acceptable to do something. You cannot justify violence by quoting proverbs. Your action was totally justified by the circumstances.