Semaphore put without get

I am doing Semaphore put without doing get and it results into creation of additional key for that semaphore. Is this proper behavior ? Why it is resulting into additional key creation??any idea??

program main ; 
semaphore sema = new(1); 
initial begin 
$display("1: Waiting for key"); 
sema.get(1); 
$display("1: Got the Key"); 
#(10);// Do some work 
sema.put(1); 
$display("1: Returning back key "); 
#(10); 
sema.put(1); 
$display("2: Returning back key once again for no reason"); 
$display("2: Waiting for 2 Keys"); 
sema.get(2); 
$display(" Got 2 Keys"); 
end 
endprogram

OutPut:::
1: Waiting for key
1: Got the Key
1: Returning back key
2: Returning back key once again for no reason
2: Waiting for 2 Keys
Got 2 Keys

This is the correct behavior. A semaphore is a very primitive operation; it’s up to the user to manage how the keys are allocated. It’s sole purpose is to provide an atomic “test and set” operation that guarantees FIFO ordering of the threads waiting for a keys receive their requested keys in the same order.

And a semaphore only keeps a simple counter of the available keys. And once you get your requested keys, there is no record of who has the key or how many you took. Usually, a semaphore is just a building block to construct a higher level mechanism, like a mailbox, or lock/unlock methods.