Entirely accidental. I do see the similarities with 404, but not much with 393 other than being an inanimate object capable of altering memory.
An explanation of my headcanon on this article: this SCP is sapient, but only barely. It possesses rudimentary emotion and thought, but its 'memory' is continually zeroed. When active and observed, it pores through memories of the observer and experiences them. It's not malicious, and the amnesia is only an unintended consequence. Hence why the thing prefers memories of loved ones - it lets it feel that connection, albeit briefly.
Now when our unlucky D-Class views it, it gets all these wonderful memories of a father who legitimately loved his wife and kids, but ended up brutally murdering them. If memories of your best friend are a fine wine, this was spoiled meat. It could see from the memories it viewed that D-67394 was a man with inadequacy issues and a short temper, and decided to do its best to hurt him because he had ruined the only joy it had.
The captions actually tell a story. D-67394 felt inadequate about his wife, and always suspected her of seeing other men. The 'explosive' Independence Day was an argument that led to the first time he struck her. Things escalated; he began to resent not only her, but the children whom he saw as taking her side. Finally, he snapped, and murdered his wife in a rage and killed his children out of shame. SCP-1223 deliberately erased the memory of the murders first in order to torment him, but its anger bled through subtly even before it got to the 'punchline.'
Of course, this is just my interperatation as I wrote it, which I decided to leave out of the article to keep it lean and to the point. Feel completely free to disregard it if it's a bit too ridiculous.