I think you've been getting an unnecessarily hard time from some posters AND the man handled the situation very badly, OP, but you are nonetheless BU in my opinion.
I would be 100% on your side if you had parked centrally within a bay of adequate size, but returned to a space to find yourself tightly boxed in because of somebody else's bad parking. I would also be sympathetic if you were taking appropriate care when opening the doors, but a gust of wind/loss of balance caused you to knock the other car accidentally.
However, it is never OK to park in a space which is too small for your to get out of without deliberately making contact between your door and somebody else's. When parking next to somebody else, you should always hold onto a door while it is open and (if necessary due to the tightness of the space) shield the edge with your hand to prevent metal-to-metal contact. As others have mentioned, your car bouncing up and down on its suspension could have caused the door to rub and cause scratches, and it would also have been easy to brush against the door or slip so that it was no longer resting but pushing against the other car.
The above is the case regardless of the condition of the other car, or any personal problems you have at the time (genuinely sorry to hear about them, btw
, and glad to hear that your DM is on the mend). Only exception I can think of is if a medical emergency occurs while you are parking, and you need to exit the car very quickly for personal safety.
On the subject of pre-dented cars: my DH and I bought our first car (an old but very neatly kept Fiesta) a couple of years ago. We weren't precious about it, but were pleased that it had no deep scratches or obvious dents, and took care to park it out of harm's way. We never found/saw any evidence of anybody leaning their doors against ours when it was pristine. However, DH once (somehow) dinged the front passenger door quite badly against a pillar whilst parking at the local supermarket, so we found a more appropriate space. We returned to the car approx half an hour later, to find a man leaning his wide-open door against the dented panel and he looked absolutely bemused when we asked him to stop it! Over the following month, that panel picked up three more light dings while we were shopping (and always taking care to park well), so we got fed up with it and paid to have the lot taken out. The difference was immediate: the carpark dings stopped happening as quickly as they had started, and we have never since found anybody leaning their door against ours
.