Why would you take identify other than to check if items have curses?
Play some Nethack and then get back to me on how powerful Identify is even after you've Altar tested an item to check for 'black flash' and curses.
Why would others bother to make items with curses?
Cursed items are actually extremely powerful. Think about the poisoned apple in Snow White. Depending on the item, a cursed item may be a powerful way to debuff or kill an enemy with low risk. It's like asking, "Why would someone create a trap?"
But beyond that, probably a lot of cursed items aren't created on purpose. They are created as the result of magic spells and rituals going wrong. They are created as the result of powerful beings being wrathful or spiteful toward mortals for whatever reason. They are created as the result of particularly terrible deeds.
In regard to the first case I think that, within a context like a session zero, it would be fair for a forming character to make an arcana check to evaluate the prevalence of cursed items and similar within a gaming world (but it may also be fair to say that general prevalence in a world may not be the same as prevalence on a particular adventure).
No GM should ever be playing "gotcha". Ever PC should understand how the world they live in works. But there is no way to cover everything in session zero. You have to come up with ways to build understanding in the players either by passing them lore as needed or else by easing them into the problem - the first cursed item a new group finds should be a relatively minor problem.
So a shopkeep has magic item/s. Perhaps the item/s are kept behind a thick stone wall, in a heavy metal box or in a lighter one made of lead or perhaps they're buried.
How society deal with magical scoundrels and high-level characters generally is a complex question with campaign specific answers.
What are the types of items that shopkeeps might have produced?
One of the most common magical devices in my setting are scales that shopkeepers use which chime whenever something magical is placed on the scale. These use only very low-level magic (0th level spells) and as such are relatively inexpensive to manufacture and are kept and cared for by shopkeepers for generations. There are also feats in my campaign that make items that only require 0th level spells cheaper to make and a variety of spells that effectively create simple defenses without needing high level support (like Permanency).
Expensive magic items are generally not available for sell in my campaign world, and even something like a
sword +1 is never just lying on some shopkeeper's shelf. The few artisans that could make a
sword +1 or
shield +1 only do so on commission with payment in advance and deliver the weapon shortly after completing it. So to a large extent the entire situation you describe doesn't exist in my world. There just isn't magic lying around waiting to be stolen.
And the few organizations that do deal in magic items have entire divine cults and nations as primary customers, and consequently are not only extremely powerful themselves but have extremely powerful patrons that will be upset if their trusted supplier has problems.
But let's say there is a jeweler, or a goldsmith, or an alchemist with a half-dozen potions for sale, each of which is worth a year's wages for a common laborer. He can protect them with trained dogs or other beasts, curtains of beads or bells over doors that thwart invisible intruders, paid guards or watchmen, multiple layers of locks, and simple physical barriers such as second floor rooms reached only by trapdoors where the guard pulls the ladder up behind him and bolts the trapdoor. He can have gongs, horns to blow, or bells that can be rung to alert neighbors who will collectively turn out to defend their town against thieves. In a world where low level super-villains can commit robbery, you don't have the same security as in a world with no super-villains. That's usually the biggest problem.