Normally flies lay eggs. Although commonly believed that all flies lay eggs, there are a few notable exceptions to this rule. There is a large fly in Africa, for instance, that gives birth to a larva that is almost as large as the mother and is quite active at birth, but this single child at a time version of fly reproduction is confined (as far as we know) to a single species. A few other smaller flies are known to give birth as well, though it is not something normally seen in the United States.
The fly in this video was captured in Los Angeles, California. I am posting it here as a simple reminder of why we should all keep flies out of our homes as much as possible.
Certainly, flies play a role in nature. They feed on rotting food, carcasses and excrement and help these things break down in the environment. The downside to this is that flies also carry germs and bacteria from their food sources and readily deposit them on everything they touch. Flies spread diseases and carry pathogens quite readily. Plus, they deposit their eggs in large quantities wherever they can find a food source for the emerging maggots.
Reducing or removing anything that might attract a fly from inside the home is an essential step in keeping flies away. They are attracted to uncovered kitchen compost containers, garbage and recycling bins. Ensuring that covers are used on garbage containers is beneficial, however it is best to still take the garbage outside often. Even a covered container may emit smells that attract flies, which will then continue buzzing around indoors while looking for a place to deposit their eggs.
If this video is to be believed, then the featured fly and others like it could simply be dropping maggots in the kitchen, bathroom or bedroom. Most indoor trash containers could potentially offer some sort of food source for flies, so ensuring they remain covered or emptied is important.
Obviously, installing screens and keeping unscreened doors and windows closed is a good idea. There are some decent non-chemical solutions on the market for keeping flies at bay. But nothing takes the place of simple diligence.