At most US schools, a D is a passing grade. It earns you credit for the course. It may still fall short of what your major, your prerequisites, or your graduation GPA require.
The catch is that passing a single class and progressing through a degree are two different standards. Most undergraduate programs require a cumulative 2.0 GPA, a C average, to graduate. A D carries roughly 1.0 grade points, so it pulls against that requirement even when the credit counts.