Have you considered that maybe God, who is love according to the Bible, designed this universe to be a complete demonstration of love? How can you fully demonstrate love if you don’t show what it means to love someone who’s evil and considers you an enemy, or someone who doesn’t even believe you exist, or someone who once thought they knew you but were being deceived by people with evil motives?
I have considered that. There is a lot of evil (or suffering) that nobody directly causes and especially not because they’re evil. Why is there depression for example? Or cancer?
As for where it came from, it was all brought about with Adam and Eve’s first sin, which infected all of creation with decay. You could write a creepypasta about that. Depression’s a bit more complicated because it’s a thing in the mind, and there’s a case to be made that it’s often more directly a symptom of a separation from God, knowing on some level that something’s missing - but I don’t think that can be said of all depression. Either way, it still ultimately stems from the first sin.
As for why it should exist for a time, it’s again necessary to be able to demonstrate love in those circumstances. It’s easy to love someone who’s always having a good time, but it’s divine to see your love and support help to pull someone out of depression, or to comfort someone who knows they don’t have long to live. (This isn’t just about the love God pours out, but also the love He inspires in His people.)