I tried to make a new address and have the same label for two addresses. When I typed "listaccounts" it showed me only the label which was the same for both addresses.
When I change the label to something else then all the addresses according to labels are listed.
Why does listaccounts show according to labels ? I mean to ask what is the logic behind it. Wouldnt showing by addresses be more meaningful ?
Accounts surely are a sum of addresses. So, what you've described makes sense.
If you want a list by addresseses then try
listreceivedbyaddress 0 true
which, if I've remembered that correctly, will list all addresses even with zero balance and their label.
List by account then, from what you've described, groups by label =='account'.