I know that there is one dog (ref. ashaab e kahf) which will enter janat so why are all other dogs considered impure / najis

The fact that dogs are impure doesn’t mean that dog will not enter heaven if it deserves it.

You are allowed to keep a dog for security reason if a need be

They are Najis because of their nature and the way they are created.