In an interview with the Financial Times, Gates said the debate was over a "specific case where the government is asking for information".
Apple has refused to unlock the iPhone of Syed Rizwan Farook, who with his wife killed 14 people in San Bernadino in December last year.
A judge has ordered the tech company to create a "back door" to allow the FBI to unlock the phone. But Apple chief executive Tim Cook has said it will create a "dangerous precedent".
"Opposing this order is not something we take lightly. We feel we must speak up in the face of what we see as an overreach by the US government," he said.
But Gates said the request was "no different than [the question of] should anybody ever have been able to tell the phone company to get information, should anybody be able to get bank records".
"Let's say the bank had tied a ribbon round the disk drive and said 'don't make me cut this ribbon because you'll make me cut it many times'."
Gates is the first big name in Silicon Valley to side with the US government. So far, Facebook founder Mark Zuckerberg, Twitter chief executive Jack Dorsey and Google boss Sundar Pichai have all taken Cook's side.