In sociology I keep reading about how ideas of government has changed, and how in the old days people really believed that God appointed kings. But was this just an excuse kings and lords used when coming down on uppity peasants or did people really look at highborn people as separate and favored by God?
Was killing a king really seen as some kind of unholy act?
Okay, so "divine right of kings" can mean a couple of things.
There are many nuances and subtle differences when you study different times and places. Consider your question about whether killing a king was seen as some kind of "unholy act". Given the near-ubiquitous association between religion and social order, in most cultures across time and space, the answer would be yes, it would be an "unholy act"... as would, say, killing your father be. That doesn't necessarily mean that your father is thought to exercise divine authority, though the general social structure of patriarchy (= Rule by the father) could be seen as a part of a divine order. Indeed the analogy between a king and a father is a common one, though probably most strongly associated with Confucianism today.
To think a bit about the sincerity of the belief of subjects, it can be useful to look at differentiation of imperial ideology across vast empires. One of the better examples is the Achaemenid Empire, where we find royal inscriptions in the heartland of the empire with a boilerplate text that reads something like:
Great is the god Ahuramazda, who created the Heavens, who created the Earth, who created Man, who created happiness for Man, and who made X king.
I am X, the Great King, the King of Kings...
A particularly extreme example is found in the lengthy Behistun inscription, where Dareios I describes practically every single action he takes as being in accordance with the will of Ahuramazda - it really is a masterpiece of royal propaganda. However, these inscriptions don't ever describe the Great King as a literal deity. On the other hand, from Egypt, there is a plaque that reads:
The Perfect God, Lord of two Lands, King of Lower and Upper Egypt, Dareios, of eternal life
What is going on here is clearly that Dareios is adapting his propaganda based on what he thinks will be best received by the subjects, especially given what a troublesome province Egypt turned out to be. The simplest explanation for why he chose this style of propaganda is then simply that the Egyptians were used to worshipping their monarchs like gods, and that Dareios played into this tradition to present himself as a traditional Pharaoh (even though he was of a foreign, invading dynasty!).
Is this necessarily so alien to us? There's no shortage of monarchs and other political figures even in the 20th century who were regarded as semi-divine or divinely inspired. I think a large part of why this recurs is that humans struggle to grasp the concept of authority. Why do some people get power? Why does anyone ever listen to cruel madmen? Why do people carry out orders that goes against their moral instinct? We have different explanations today (see e.g., Weber's three theories of authority, or phrases like "I believe in the system...", "I'm just doing my job...", "the law is the law...") but I think this is something that viscerally bugs people who think critically about the societies they live in.
Almost anywhere you see a powerful monarchical institution in history, you see the appearance of various auxilliary concepts that seem to exist only to justify the existence of monarchy. A particularly good example is the xwarrah of Iranian epic, often translated as "glory" or "splendor", a divine substance or qualities possessed by rulers, which can be not only tarnished by sinful behaviour, but also stolen by evildoers like the serpent Dahaka. The word does not actually appear in the Old Persian corpus (possibly because it might have been composed in Elamite and translated into Persian) and is instead replaced with the notion of xshaca, usually translated dominion, a quality of the Great King that extended over the various lands he ruled over. However we do find in some Greek writings repeated for example the notion that the Great King was expected to be the most able, pious and virtuous of the previous king's (carefully groomed) sons, not necessarily the eldest one.
I think beliefs in "divine rule" of various kinds seems less like a strange phenomenon and more like a very useful partial explanation for explaining how, for instance, the Achaemenid dynasty was able to monopolize political legitimacy in the Near East for two centuries, or how the Sasanians clung to power for four centuries amidst the many powerful Parthian noble families - it was to some extent accepted as part of a natural, divinely imposed order. Even more so when you consider how present the divine (or supernatural) was thought to be in the everyday life of humans in the vast majority of these societies. It doesn't seem like much of a stretch to think it part of human institutions, too.