I used protection but I got chlamydia. How is this possible?

Exposure. Condoms, spermacides, libricants, genital washes all have been promoted for cutting down std's. Yet none provide complete protection. Any exposure to an experienced partner may get you any std.
Possible. This is possible if your protection was not foolproof (such as a condom break) or unprotected sex before or after condom use.