Although semicarbazide has two – NH2 groups but only one of them is involved in resonance as shown below.
As a result, e density on one of the – NH2 group is reduced and hence it does not act as nucleophile. One pair of the other – NH2 group is not involved in resonance and hence it is available for nucleophilic attack.