I will not speak for others but some of why people do it is addressed in Why Do Some People Answer in Comments on the main Meta Stack Exchange (S.E.) Website. The matter is also addressed in a similar topic here on our local Meta in Why Are Answers Being Posted in the Comments on the Question.
As for the the matter regarding what to do has already been addressed on the main Meta S.E. website a few times times before. The canonical question there is What should be done with questions that have been resolved as a comment instead of an answer? The top rated answer there, by user Iain reads as follows:
We discussed this on meta.serverfault a short while ago and decided that you should Steal comments that answer the question and post them as an answer. You can always tick the Community Wiki box if you're not comfortable earning reputation for someone else's work.
The top rated answers on a meta post are supposed to set the policy, provided that something else doesn't superscede it. However the secondary answer raises the important point that it is not an excuse for plagiarism, so if you are directly quoting the comment, then you should follow our rules for referencing material written by others. Even though it may seem as if the original source should be obvious, it is still important since comments can become hidden if enough other comments are made, or disappear for no reason whatsoever.
You may also want to consider flagging the comment for deletion, if it really is an answer, because many website mechanisms are heavily predicated upon the premise that comments and answers serving a different scope, which is defined by our commentary guidelines. To closely paraphrase the relevant portions for your convenience:
Comments are for clarification, constructive criticism and minor or transient information, like a related link to a related question. They are not for answering the question, or providing an alternate solution to an existing answer, and an actual answer should be posted instead.
If you flag a good comment for deletion, you may want to post it as an answer first, because otherwise there is no retrieving it, if it is. I suggest considering using the community wiki tickbox if you post just the comment, so that others may expand upon it, if it does not suffice to stand as an answer on its own merits.