When a ship is awash with water and unable to manoeuvre normally, it is said to founder. Perhaps because flounders are fish in the same seas as the ships, it’s almost more common to refer to a ship, today, as floundering than foundering.
In fact, in one of the references added here, flounder is actually given as a vocabulary word, erroneously defined as a boat awash in the sea.
Addendum/edit by CW, 2005/10/25: The substitution _founder/flounder_ (in both direction) has been submitted to the Eggcorn database several times and is discussed by Paul Brians and the American Heritage Book of English Usage. It is, however, not an eggcorn. The two verbs are phonologically and semantically similar, but it is unclear that one is being reanalyzed in terms of the other. An eggcorn requires that someone has understood the sense and spelling of word they actually employ, but not the word that is conventionally used in that particular case. See also Arnold Zwicky’s discussion of _flout»flaunt_ (also not an eggcorn).
Addendum/edit by AZ, 2005/10/26: Harsh, Chris, harsh. In fact, some people have explained to me that “flounder” is the word to use, because a ship in this sort of distress flops about like a fish — a flounder, in particular — out of water. The association with flounder (the fish) seems to be unetymological: OED2 labels it “of obscure etymology”, suggests various non-fishy sources, and gives as its earliest sense the not particularly fish-related ’stumble’ (attested from 1592). But then the sense extended to ’struggle violently and clumsily, struggle in mire’ and the way was open for comparison to a flopping flounder. (Suspiciously, several of the OED2’s citations actually mention fish.) In any case, “flounder, founder” is a great favorite of usage advisers: there’s a MWDEU entry with references to earlier writers, and most of the recent usage dictionaries have an entry — Bryson, Burchfield, Fiske, Garner, O’Conner, and Steinmann & Keller, in addition to Brians and the American Heritage folks. Of these authorities, only Steinmann & Keller (Good Grammar Made Easy, 1999, p. 140) seem to make the fish connection, but they still tell you not to use “flounder” for sinking vessels: “flounder, founder Sometimes confused. To flounder is what a fish (the flounder, for example) does out of water (move clumsily); figuratively, to be active without accomplishing anything. To founder is to sink because full of water: figuratively, to fail.”