Yes, it has to do with intonation.
In theory, the 12th fret should be exactly halfway between the nut and the bridge. In practice, though, the string is pulled slightly sharp as you push it down against the fret. So the distance between the 12th fret and bridge has to be slightly longer than the distance between the 12th fret and the nut. The amount by which it is longer depends on the string, which is why the bridge is angled.
I don't know why violins and cellos have perpendicular bridges, but I'd guess that with a fretless instrument, you can adjust the intonation as you play, so there's no need for the bridge to be at an angle. (Though with fretless basses, they still angle the bridge.)