That's because we humnans have identified a classification called "mammals," to which bats are more similar to.
It would also be obvious to God that insects have six legs, not four
Once again, that's because "insect" is a classification of animal that we humans have devised.
Now, why would God indulge these misconstructions and not set those Iron Age goatherders straight? Why is it that God did not seem to know any more than the folks writing about Him?
Because the Bible was written to Iron Age goatherders. It would be ridiculous to expect scientific precision in that time - especially in a science that is defined by men's decisions, not a quantifiable phenomenon.
And locusts having four legs is a classification other humans devised.
God would know that locusts do not have four legs, regardless of whether or not the people back then did. God would know that rabbits do not chew their cud, regardless of whether the people back then did. God would know that bats were not "foul" regardless of whether the people back then did -- and God never even tried to set the record straight. If everyone back then had said "locusts have four legs" and God came along and said "locusts have six legs" it would be one of the most revolutionary statements in history. But God didn't do this. Indeed, God apparently is no more knowledgeable than the folks writing about Him.
Bats are mammals
It would also be obvious to God that insects have six legs, not four
Once again, that's because "insect" is a classification of animal that we humans have devised.
The quote from Leviticus specifically mentions locusts and/or grasshoppers. All known species of locust or grasshopper have six legs, as do all other insects.