Mathematical logic and foundations

Why does the fact that every set is a subset of itself not contradict foundation?