I bet you are having the same problem I was. I posted about it months ago and the solution. I will re-post it here:
I am writing this mainly to help someone in the future who is having the same problem I am and what I figured out is the problem for me at least.
When I go to unlock my 2014 Spark EV with the key fob or even sitting in side and using the door lock button on the arm rest the doors unlock and immediately lock. This has been driving me crazy for over 6 months. I would have to time it just right pressing the key fob and then lifting the handle to open the door before the doors locked themselves again.
Here is what I found out was the problem. I took the door panel off and peeled back the plastic dust over. There are two sets of wires. One set powers the door lock and the other goes to a sensor triggered by the manual door lock when locking or unlocking the door with the key. This is there in case your key fob breaks or the battery dies you can still get into the car with the key. The sensor must have gone bad and was telling the car that the door handle lock has been locked manually with the key.
My temporary solution was to simply disconnect the sensor which wasn't easy. If you have big hands forget it. Find someone who has long thin fingers or small hands to disconnect the sensor. The sensor's wires are on top and you have to reach behind and lift up a tab and push or pull the connector towards in the inside of the car perpendicular to the door.
The other wire that runs to the motor actuator that actually locks and unlocks the lock . The connector is at the bottom of the actuator and you pull the tab down and then pull the connector towards for front of the car parallel to the door. This connector is way easier to get to but you
do not need to disconnect it if you are having the same problem I am having. I am describing it here so you will be able to tell which connector is which.
At some point I will have to replace the sensor and most likely the whole power lock motor actuator. I tried to loosen the three bolts that hold the locking mechanism but two of them must have been put on by a gorilla. My hope was perhaps it was just out of alignment slightly. I got two out of three loose but the third started to strip so I stopped before I completely ruined it. Might have to take it to a local mechanic and pay him a few bucks to loosen it for me.
With the sensor disconnected the locks are working perfectly. I can still unlock the car with the key but as soon as I open the door the alarm will go off. I am assuming that if I stick the key in the ignition the alarm will go turn off. That will be a last resort only if my key fob is broken or its battery has died.
Anyway, I hope that helps someone out there in the future.
UPDATE: I never did replace the sensor. The only thing you lose when disconnecting it is the ability to lock all door locks at once by manually using the key to lock the driver's door. Also, just to make it clear the lock sensor is in the driver's door.