Hello! I agree with the answer that Jacobo V gave, however I wanted to chime in and relate the idea to guitar specifically.
Firstly, the standard "open" form of a D chord does indeed have a D note as the bass note; the open D string should be your lowest note. (The shorthand form of this chord would look like X-X-0-2-3-2; the E and A strings are not played, but the D is played open, which is lowest note in the chord.)
So it's possible you are playing the chord incorrectly, or not including the open D.
Secondly, the only chords that should be "inverted" (that is, have a bass note which is not the root note of the chord, in this case D) will be written as "slash" chords:
D/F# (Commonly played as X-X-4-2-3-2)
D/A (Commonly played as X-0-0-2-3-2)
These are telling you that you are playing an "inverted" D chord, where the bass note will not be the root, D, but either F# or A instead.
So! If you see a chord name without a slash, it should indeed have its lowest note be the root note of the chord.
Finally, just in case this isn't 'clicking,' you used the term "bass note" where you more correctly meant "root note."
For example: "Hi! I'm curious why the root notes in some guitar chords aren't the lowest. In the D Chord, the D note is the second lowest"