In D&D, they seem to be in-built, not acquired. Though reflection produces several ways that could happen.
Most origins I've heard involve bungled creation, but there are others. The guy who meant it work that. This is generally, when it's used, done by someone who is, as much as a pirate, hostis humani generis and willing to curse anyone who stumbles on the thing -- but there are no doubt those who would target it. A wizard who makes a mirror that shows the tyrant himself as the all respected and powerful ruler he imagines himself to be, until he just sits and stares at himself, does not necessarily mean the harm it could do others; if he's aware of it, he may accept it as a grim necessity. Items that sap strength and the like could be used for prisoners. And so on.
Then there are those creators who would be dumbfounded if you regarded it as a curse. What escort, full of hit points and with a high armor class, would not love a shield of missile attraction that would not only prevent their foes from shooting the more fragile party members, but actually gives an armor class advantage? What party, trying to clean out a dungeon, would not regard an amulet of monster attraction as a good way to winkle them out? True, prudent tactics would be needed to prevent either one creating overwhelming situations, but life is full of trade-offs. To be sure, if that's the case, a spell to remove the curse should not be needed.
Likewise if the bungling was in the conception, not the execution. A ring of contrariness devised as a way to protect the bearer against not only charms and other spells, but also from ordinary persuasion. A ring that forces you to tell the truth as a way of demonstrating honesty. A sword with no powers but to delude its bearer given to a fool to keep him more or less harmless. The curse is not intended, and needing a spell to remove it suggests more the meddling of some kind of evil or mischievous spirit than bungling.
It would be more logical for the intentional curses, of course. And also for acquired ones. Merely being wielded by a horribly evil character, or cursed by a dying king, or the like would clutter up the land with cursed objects. Perhaps it need the intervention of some kind of powerful being, or to happen in an exceptionally magical place. It could be a spell -- but not the wimpy bestow curse, more on the level of wish, actually.
A living dungeon (or a demonically created one) that created treasure to lure adventurers into its grip would probably like to make all the magical objects cursed -- if its thinking is human enough -- but then it would not work as bait. It would have to be rare enough to convince the characters to use it.