To Diamond, the major reason why Japan lost (or, better, abandoned) gun technology was because of its isolation. If Japan had not been so isolated by its geography, it would not have been able to give up this technology.
Diamond is arguing in Chapter 13 that circumstances make some places more likely to adopt technology and others less likely to do so. Japan did not keep gun technology because it did not need to. Japan was so isolated by geography that it did not need guns to be able to protect it from enemies. Therefore, it was able to keep using its traditional ways within the country without having to fear that some other country would come in with guns and conquer Japan.
The answer, then, is that Japan lost this technology because it was isolated and, therefore, did not need guns.