This is not correct - electric charge can also escape from a black hole.
The actual answer is that it is energy that can not escape and a static gravitational field (or electromagnetic field) is not energy (in and of itself).
However keep in mind that time is frozen by a black hole, so if you have a black hole with a certain charge, and a new charge falls in, the "change" in charge never escapes (it takes infinite time to escape) so you have no issue of non-static gravity or charge escaping from a black hole.