I had a similar problem with a car I purchased from a friend. He, of course, made no mention of it when I went to get it. Anyway, long story short, I took off the interior door panel and the automatic doorlock actuator (the thing inside the door responsible for locking and unlocking the door, and possibly the noise you keep hearing clicking) had been attached improperly.
My friend bought the car used and I'm pretty sure that it was a repo. But he drove it around and had fun. There are numerous signs of an AM car alarm at one time being installed, and later various components were removed. Anyway, it's entirely possible that, if the guys installing the car alarm system had to take off the door panels to mount their alarm equipment, they did the same thing that happened in mine. I would ask them, and then if they deny it, try taking it to a mechanic you trust and then to a dealer.