It is pretty common worldwide to have an employee or security guard complain if you take a photo in a store, even if you were well-meaning and your objective merely was an artistic shot. This isn't limited to Portugal per se; I have been scolded in many other countries as well (the US, France, Italy, Spain, South Korea, and India immediately come to mind).
If you pay close attention, some chain stores and malls have a "no photo" logo on or near the entryway door (next to a "no smoking" logo and/or other prohibitions); you will want to avoid/use more discretion in those locations in particular. If you're not a frequent photographer, these often are easy to overlook.
Based on personal experience, it seems that you are more likely to receive a complaint in an area where there are many tourists or no tourists. In an area with many tourists, photography may be so frequent that it annoys the staff and they pay extra attention. In an area with no tourists, photography can be unusual enough to attract concern from security.
Demanding you delete a photo is rather extreme, though. In this specific case, the employee probably thought you were price checking. I have been scolded in similar situations for taking this kind of casual photo to send to someone else to confirm the correct product to buy for them or let them choose from two dozen alternatives because what they requested was unavailable, etc. Obviously, sending a quick photo via chat app is more convenient than leaving the store and coming back; clearly the intent is positive. If the staff complains, it can mean that the price is too high and you should buy somewhere else.
In practice, should you wish to photograph inside a store and it's not an Instagram friendly type of place that encourages it, you need to also be clearly shopping at the same time to attract less attention. Do your best to not photograph customers or employees and make it clear that you are not doing so — that would be rude if nothing else — and be both quick and discreet. In many cases, you only will get one shot; use it wisely!