The term computer bug comes from a literal bug. A moth got stuck in the Mark II computer causing issues.
The term could also come from bugbears, pests that aren't visible, but that's a more boring explanation.