Because matter and energy are equivalent, according to another of Einstein's theories, all of the matter inside the black hole are converted to energy, and you can have as much energy in any given volume as you like. Energy doesn't need to occupy any volume, unlike matter does.
Now there are next-generation theories, beyond quantum physics and relativity that postulate that even energy can't be compressed into infinite density, but the maximum density of energy would still be higher than the maximum density of matter. So whether there is a maximum density or not, black holes can still form, with an event horizon and all, it's just a slight difference about what happens on the inside that changes. In pure General Relativity, it becomes a singularity. In a next-gen theory, it is a high, but not infinite density. Doesn't make a difference to our understanding of black holes from the outside though.