The word 'er' is a tricky one, and it can serve different functions.
In some case it may be "necessary for an unspecified subject" , like in the phrase "er wordt gepraat". (passive without a subject)
But in "waarom is hij er niet" the word 'er' is a kind of unstressed replacement for the word 'daar' (= there).
If you want more information about 'er' then this is a useful (but long) article in english: