A flooded basement is a breeding ground for mold. Mold can cause allergies and other health issues.
Talk to your agent about adding a condition to the contract that the sellers pay for the damages and get flood damage fixed before closing. However, if the home is owned by a bank, it will typically be sold "as is."
Some damage can be fixed and prevented from recurring by correcting the cause of flooding. Common causes are poor guttering, runoff from rainwater or water from an external hose due to poor outside drainage, large amounts of rain, or a faulty sump pump. More serious causes can include broken sanitary or water lines, clogged or crushed drain pipes or a build-up of groundwater due to a capped spring in the area or a foundation installed without perimeter drains to divert water, according to the University of Tennessee.
If you decide to buy the home, expect to work hard to clean up your flooded basement. The leak must be fixed or exterior grading and drainage issues addressed. The wallboard and carpet must be removed. Finally, the basement must be thoroughly cleaned.