There are a number of reasons to use compression -- or not. EDIT: this is not a comprehensive list of uses, just the first ones that popped into my head!
- The most common reason is subtle, transparent smoothing, as done on nearly every studio recording. Done live, it can help the bass to sit better in the mix.
- Another reason is subtle production: to add tube-like/vintage "warmth" to the tone.
- Another is as an effect: to add heavy squash and/or overdrive. This was done in the studio by Led Zeppelin and many others; often with the Urei 1176 in "British Mode"
- Some compress only when playing slap style
- Some compress to hide uneven playing technique (this is not a good idea when practicing at home, but understandable when playing live)
As for me: I often use overdrive at the gig. Overdrive by its nature provides some compression, so I rarely use a dedicated compressor when using OD. However if I'm playing a classic rock/R&B/blues gig where I won't use overdrive, then I do occasionally bring a compressor for transparent smoothing and/or vintage warmth.