I am not happy with people making an anonymous username, asking a question, getting the answer and then deleting that user name withing 24-48 hours. It has been happening for sometime now. I do not think it is right. I would like to know what other people think about this.
The comment you left on the question was for an unregistered user. A person doesn't need to create an account to post questions/answers.
Note also that a user cannot delete their account by themselves (if they have interacted with the site, have cast votes or have posted questions/answers). To delete a user account you have to involve an SE or a community moderator. Please see this for further information and the process through which a user can ask SE for deletion of their account. In short, what you have described cannot happen.
I personally haven't seen any request for deletion recently (can't remember when was the last time).
Regarding asking questions anonymously, by default, asking questions or answering questions using pseudo-names or anonymously is completely fine. People have various reasons to remain anonymous or to use pseudo-names. I don't see any reason to be annoyed about this. If you don't like such users don't interact with them. Whether to remain anonymous or to reveal identity is that user choice, not yours nor ours. If there is a problem about a question posted by an anonymous user (e.g. it is a homework questions) then we can discuss that particular case separately. By itself remaining anonymous on the site is completely fine.
Please don't write comments like "And we we would love to know who you are!". This is not constructive. A user doesn't need to reveal their identity to ask questions. People are welcome to post questions and answer anonymously. Also, IMO, down-voting questions just because they are posted anonymously is a very bad behavior.