The grouping isn't based on grammatical similarities exactly. (Generally the grammatical properties are similar though!)
Genetic classification is based on history only, where the language originated. A language might in theory lose all of its vocabulary or have extreme grammatical changes due to contact, and it would still have its origin in the same "genetic" ancestor.
For pidgins and creoles, the situation is a little more complicated (and those really are the most extreme examples of borrowing and changes). For this reason, many linguists don't try to put these languages into genetically based groups. (Instead, they use geographic or other classifications, like what the lexifier is.)
There are really two separate questions here:
1. What is a genetic grouping in Linguistics? [answered above]
2. Why would anyone want to do that? What would they use it for?
I think this can be explained by going back to the history of historical linguistics.
Sir William Jones suggested a number of languages were related including Latin, Greek and Sanskrit, due to what appeared to be systematic similarities:
https://en.wikipedia.org/wiki/William_Jones_(philologist)
Following that, others, including Jacob Grimm, discovered various systematic correspondences in these sub-groups. For example:
https://en.wikipedia.org/wiki/Grimm%27s_lawThese systematic correspondences indicate (systeamtic) sound changes that occurred in the history of the languages. So Germanic F/TH/H correspond to other Indo-European languages with P/T/K. By going a few more steps in the reconstruction, it is believed that originally a language we refer to as "Proto-Indo-European" had sounds P/T/K (still surviving in, for example, Latin and the Romance languages, among various others) and that at some point Proto-Germanic had a sound change. So in all Germanic languages (English, German, Icelandic, etc.) we have words like "father", while in the other groups they have words like "pater".
By looking at genetic groups in this way, systematic correspondences can be identified and the history of languages, and some grammatical properties of their ancestors, can be deduced.
If we didn't use genetic groups like that, none of those methods would work. If we borrow a word from French or Latin into English, it wouldn't have the same changes! Consider "paternal" (a borrowing) as opposed to "father".
So the answer is that
genetic classification is useful for reconstruction, among other motivations.
Another less interesting answer might be that in general lexical items (words, vocabulary) are not given very much weight in terms of grammatical theory or otherwise. They're just the details, and they're arbitrary. There isn't a legitimate reason to say this is the "right" way to do it, but it's just one way to classify things.
There are other times when we do consider borrowing and so forth. For example, there are very limited written records of Basque before relatively recent times. But by looking at words borrowed into Basque from Latin (or early Romance dialects), we can actually figure out certain properties about the history of Basque itself. We know what the Latin borrowing was originally, and we know what it is now in Basque. So if we see a difference, and that is probably not due to the way it was borrowed originally (for example, if a sound in Latin also is in Basque, but the modern Basque borrowed word has a different sound in it), then we can date some sound change to after the time of borrowing from Latin. These cases are relatively rare and more complicated to deal with, but the point is that different classifications, borrowing, and so forth
can be relevant. But they don't replace genetic classification for the purposes that is usually used for.