The blade of a foil is a long, flexible metal rod. It is dull at the end, and it is expected to flex very heavily in normal use.
If it snaps, I assume you end up with a short metal rod with a sharp, jagged tip. (And the part that used to be the tip will go flying off somewhere.) That would be dangerous for the same reason a window breaking is dangerous.
To add onto what other people are saying:
When a blade breaks, not only is there a potentially sharp point on the new end of the blade, but the blade that's left attached to the handle is probably more stiff - possibly quite a bit more stiff - than the original sword. This is for a couple of reasons:
1. Leverage: short things are stiff, long things are floppy.
2. Profile: I honestly have no idea if this applies to olympic swords, but in historical swords used for combat, blades will often be quite wide at the base and taper towards the point.
Many historical swords taper in width, thickess, or both in order to improve handling. Distribution of mass matters quite a lot in how nimble a sword is, especially for historical swords which were heavier than modern fencing weapons.
Come on now, how can you say this and not expect me to make a wiener joke?
:-D