I assume its an 1157 bulb. The pins on the side of the bulb should fit into grooves on the side of the socket. The pins rotate into sideways parts of the grooves as you twist the bulb into place. Theyy are at different heights from the base so the bulb can't be put in backwards. A spring under the contact plate should push it tight against the bottom of the bulb. This tension holds the bulb pins tight against the sideways part at the top of the groove in the socket. Which part of this isn't happening in your setup?

regards,
Leon