1) The filling is not being bonded into the tooth properly, possibly due to saliva contamination or something else
2) The filling is simply too big or in an area where there are too many biting forces on it for a filling to work and you'll need a crown or a veneer
3) You're doing something with your teeth that's causing it to fail, e.g. opening beer bottles, biting insulation off wires (don't snigger, I've seen both of those!).
4) The filling isn't being cured properly, sometimes the blue light is failing due to somebody dropping it and breaking some of the fiberoptic core (seen that one too!). It sets the superficial part of the filling but the base remains soggy.