There are many reasons why an aquarium filter can get dirty quickly. If your fish tank is overpopulated, the filter will get dirty quickly because of the increased production and release of excess fish waste into the tank. If you leave uneaten foods in the aquarium, it will make the water get dirty so fast.
Other factors that contribute to a dirty aquarium filter include: using activated carbon or other types of filtration media that adsorb wastes and bacteria, adding salt aggressively to your tank for alkalinizing purposes, having a high level of dissolved oxygen in the water, intensive bacteriological activity (due to high levels of nitrite or ammonia), stirring the water often, using an aggressive UV sterilizer or ozone generator