It's better to do whatever sounds better, and often people use a combination of both. Getting a good clean DI recording allows you to come back later and re-amp it if you have an amp sound you want.
Bear in mind that a combination of stock EQs and compressors in software will produce something superior to most cheap bass amps, but if you have a Hartke, Ampeg, decent Laney or Peavey or whatever, give it a go with either a condenser about a foot back or commonly a kick drum mic closer.
Maybe it's my imagination but I seem to end up with less fret buzz and string noise when I use amps, but I usually need a DI sound anyway. Try some of each and see what results you get. What bass, amp, DI and interface/preamps do you have?