I assume it is not illegal to stand next to one's car, therefore you must have been ticketed for parking your car illegally. Standing next to your car does not change the illegality of the act. When the car is not in motion, the keys are not in the ignition, and the driver is not in the driver's seat, then the car is considered parked. It is as simple as that. Standing next to the car just made it easier for the cop to hand the ticket to you instead having to place the ticket on the windshield.