psalm 137 to which you refer is written from the point of view of the
captive. the israelites in battle used to sing and shout praises
to
God. Because of sin they now find themselves languishing beside the
rivers of Babylon and their captors mocking them require them to
sing.
The irony is obvious. The writer turns to prayer expressing his
love
for his homeland and God and wishing the worst for his
captors.
The bad things that happen in this world is the result of sin. (The
wages of sin is death.)