Most types of plastic are rarely consumed by bacteria, so they don't decompose like most organic material. However, certain types of plastic are designed to biodegrade, and certain bacteria can slowly consume non-biodegradable plastic.
Plastic is widely used because of its low cost, versatility and durability. This durability is partially based on plastic being an uncommon target for bacteria, which makes it a viable option for shipping items and for long-term use.
Most forms of plastic degrade in the presence of light, which is partially why the oceans are filled with tiny pieces of degraded plastic. Plastic that ends up in landfills, however, is typically buried, so it does not degrade like plastic in the ocean.