Theoretically, there is no need to run into a DI and then into an external soundcard. In practice... maybe.
The job of a direct input box is to convert a guitar's or bass's high-impedance signal circuit to a low-impedance mic/line circuit to send "directly" to the mixer, instead of capturing the instrument's sound by putting a mic in front of the speaker cabinets. In live sound, a direct box gives the sound engineer a cleaner bass sound with less fiddling to mix in to the PA mains; a cabinet mic will pick up other sound including the crowd, and mic positioning has an important effect on tone so sound checks will take longer as a stage hand futzes with the cab mic to give the sound engy what he wants. A DI also reduces the required size and power of a bassist's "stage rig", often to just the DI itself, as the DI pumping his sound into the PA should give the band all the bass they need through the system's mains and monitors.
While designed for these stage uses, they're also useful for recording, as they allow inputting instrument signals directly into studio equipment like multitrack recorders, with no microphone needed. This again gives you a cleaner input without, say, the sounds of your three elementary-age daughters banging around upstairs doing God knows what (just a hypothetical, in absolutely no way whatsoever related to my personal experience laying down tracks). It also allows you to lay down guitar riffs or bass lines into your DAW at any time of the day or night, without needing a mic'ed amp blaring your bass tone at performance levels into your SM-57 (and the rest of the house).
Now, your average external soundcard (aka "audio interface", to further differentiate from the internal soundcard hardware of your PC) will commonly support "Hi-Z" inputs by incorporating a DI transformer circuit into the interface design. That increases the value of this piece of gear, and reduces your initial investment, by reducing the need for additional equipment in your home studio to make the interface useful. Almost all the major brands and models of USB audio interface allow plugging in at least one instrument. So, you don't need to have a separate DI in the signal chain.
Now, here's where theory meets practice. These audio interfaces are built on a budget, to meet a pricepoint that's attractive to the average music hobbyist. As such, they usually cut a corner somewhere, and one option is that DI circuit. To avoid making the interface too large (and heavy and expenive), a much smaller transformer coil is typically used for each input, and that has an effect on sound quality. A dedicated DI box will usually have a more substantial transformer, that more faithfully reproduces the upstream signal. That signal, now balanced and running into the interface via an XLR or TRS cable, will bypass the DI circuit in the soundcard, giving you cleaner tone and less noise in the DAW tracks.
Dedicated DIs can also have other circuitry, ranging from a simple gain boost ("Active" DIs boost the gain and reduce transformer impedance to reduce signal attenuation over a long run through the snake to the sound desk) to a full tone-shaping preamp (the LR Baggs Paracoustic DI is a combination DI/preamp designed for acoustic guitars; the Tech21 SansAmp is a more well-known general-purpose preamp for electric guitar and bass). If you get your live performance tone through one of these devices, there's a lot to recommend keeping it in the signal chain in your home studio at least as a starting point, and very few reasons to skip it.