Because I received messages that were not meant for me. I got this iPhone from someone who removed his SIM card from it. And then I received messages for him that should have been delivered to his phone (the phone he put his SIM-card in).
Under settings on the iPhone there's the option to completely wipe the phone. Before you give your phone to someone else you should do this. Otherwise you were still logged in to his iMessage account.
The security problem here is the person who gave you the phone thought removing the SIM erased all their personal data/accounts and it definitely does not.