Ordinary/living people in different Provinces have different beliefs, morality, government, customs etc - why woud Liches and Vampires be different? all beings are influenced by their cultures and race plays a part in that
That's true, just because some people are undead or associate with undead doesn't mean that they'll all be friends.
The most logical explanation would be that, for one reason or another, the independant liches you see who are hostile to necromancers just have conflicting interests with them, or just hate necromancers, and the same goes for vampires. Of course, Bethesda could have also just forgot to set their factions to be friendly (unless there's some piece of lore I'm neglecting that supports them all being hostile to each other, of course.)