/u/TheDarkLordofViacom (now that's not something I ever thought I'd type) has already kindly linked to one of my older answers relating to this question, which also includes some great reading recommendations. I'm going to try and talk to your question a bit more broadly and theoretically.
The first thing that I would suggest you have to keep in mind is that people are not perfectly rational economic actors - much to the frustration of economists around the world, I gather. Human beings do not always act in their best economic interest, even if they are logically aware of what that interest is; a whole range of factors and considerations play into how we behave in a particular context, and even then, it is difficult to anticipate the behaviour of any one particular individual - people are complex and unique. By way of an example that we can relate to today: how many of us spend money on lottery tickets knowing we don't have a great chance of winning, and that we would probably be better off in the long run if we didn't buy them every week? We can't all win the jackpot, nearly all of us will lose out in the pursuit of it, yet millions of people still participate. Human beings aren't always very good at doing what's in our best objective interest.
Now, it is also worth pointing out that your average slave was not going to die from being beaten to death. Physical abuse and violent degradation are absolutely an intrinsic part of the experience of slavery, but not to the extent whereby slaves are being outright murdered in gross numbers every day - that, as you correctly say, would be severely uneconomical. You aren't going to do very well as a farm owner if you kill half your work-force every few months. Likewise, Southern law generally did prohibit the outright murder of slaves on paper; in theory, only the authorities were supposed to be able to exercise the right to capital punishment. The intensity of these laws vary from quite mild (punishing murder with nothing more than a light fine) to quite severe (Georgia's 1798 Constitution held that murder was always to be punished as murder regardless of the victim's status).
In practice, these laws were almost universally disregarded - they included all manner of "ifs" and "buts" to protect slave owners (for example, you could typically kill a slave if you claimed they had been resisting you or if it was a genuine 'accident' in disciplining them, and other slaves would not be allowed to testify against you) - and their enforcement haphazard. Nonetheless, their existence does reflect a certain recognition that the widespread killing of slaves was undesirable - politically, morally and economically. On very (and I stress very) rare occasions, these laws would be enforced to their full implication; for example, we know a white man in South Carolina was put to death for the murder of a slave in 1853, after white associates testified against him after a life of cruelty to everyone, his white family included.
But certainly, slaves were treated very harshly in general. A whole range of severe punishments were not merely tolerated in law but even outlined explicitly - and as time goes on, slave owners and masters become particularly adept at determining how much pain you can inflict on someone without rendering them unable to work. One of the popular images of slave punishment you will undoubtedly be familiar with is the practice of whipping the bare back; whilst incredibly painful and damaging, and it can certainly disable and kill you, that kind of punishment still avoids inflicting lasting damage on the parts of your body that are most valuable in agricultural labour: your arms and legs. There are ways to physically injure and torture someone without necessarily doing long-term damage to their capacity to labour for you. It is remarkable and tragic what the Human body can endure in the 'right' circumstances.
Now, why would a plantation owner want to treat their slaves harshly? Well, fundamentally it's about control and it's about power. Even with the horrendous experiences of the slave trade, it takes more than just telling people "I own you" to make that statement a social reality; violent degradation and discipline were an inherent and intrinsic part of slavery as it was practised in the United States. The institution of slavery depended upon violence as a means of controlling its victims: using physical punishment to extract as much labour as possible by motivating people to work beyond what they felt they could (because you'd rather be in pain from absolute exhaustion than from being whipped until you're a bloody mess), to punish them for transgressions against the social order you're trying to impose, to deter them from acts of rebellion or resistance, to keep them afraid and humbled before you. It's a means of ensuring control. Sometimes, you might find it effective to make a particularly horrific example out of one slave who commits a transgression (whether real or invented) - whether that's horrendous torture or outright murder - in order to deter others from following in their footsteps.
The requirement for this kind of behaviour stems fundamentally from the nature of freedom and unfreedom. We often think of freedom in positive terms; I am free to do this, I am free to say this, I am free to think this. But that's not what freedom is; it's not something tangible you can own. Rather, freedom is a relationship between people. To be free to express yourself means that someone else cannot stop you from expressing yourself; to be free to think means someone else cannot stop you from thinking whatever you want. To be unfree is to be in a position where someone can do these things to you without facing consequences from wider society. If you want to enslave someone then, to exploit them in the most extreme form possible and reduce them to property, it is necessary to push that relationship to an extreme. Violence is an effective way of enforcing that kind of domination; the violent abuse of slaves is fundamentally an exercise in the creation and maintenance of power, because the threat and practice of violence serve to prevent the victimised party from exercising any claim to power. As an institution, slavery is arguably only possible with some measure of violent coercion. It is a crude but incredibly effective tool for enforcing power (though it is by no means the only instrument for doing so).
Now, within that framework, you get considerable variation in how violence is applied. There are certainly some slave owners who are very reluctant to apply it, reserving it for only the most extreme cases of disobedience, dissent or laziness; there are others who see it as a fundamental experience of slavery and who would happily subject even the most 'well behaved', productive slave to violent punishment as a means of reminding them of their degraded status. There were those who would never dream of intentionally killing a slave except in (perceived) self-defence; there are others who relished the thought of being able to do so. The vast majority of slave owners probably belonged to neither extreme. Certainly, violence was a common and intrinsic feature of the enslaved experience as a means of slave owners enforcing their power and achieving what they felt was maximum productivity from their workers.
In the United States, it was not uncommon for slave owners - at least in the 19th Century South - to articulate their justification for punishing slaves harshly as a kind of parental discipline. Many of the contemporary advocates for slavery would tell you that they were trying to look after their slaves by being violent with them; the culture of the South conceived the slave owner as a father figure to the slaves. As a loving father might (in their minds) strike their child (or indeed, their wife) to instil discipline, promote obedience or correct a wrongdoing, so too would a slave owner whip his slaves to keep them righteous and obedient. Violence was seen as corrective in both law and culture, as much as it was punitive; in essence, as far as some planters were concerned, a thorough beating was good for the soul.
But there are certainly other factors I would say that it is really worth paying attention to as well. The first, and perhaps most important, is race. Slavery and race cannot be separated out from one another; they are very much parts that belong to each other. Though racism achieves its greatest ideological coherency and virulence in the antebellum Southern United States, throughout the New World slavery becomes a deeply racial system based on the degradation, domination and humiliation of one race - Africans and their descendants - by another. In that environment, it is not hard to imagine how some slave owners might take entertainment, pleasure or some satisfaction in the abuse of their slaves.
We should also consider who is committing the abuse; an overseer has no concern for the economic investment in a slave - on large estates, they might be rather more willing to be harsh in their treatment even if an owner was not. Likewise, the potential for a slave to be sold off is important when making economic considerations. If you have no intention of ever selling a particular slave because their value has declined or you simply don't need to, or if you have an abundance of workers, or if that slave has already 'replaced' themselves by having children, then the loss of one through murder or severe injury certainly isn't that devastating if you have hundreds more to work for you. If you're a large estate owner with a penchant for excessive punishment or abuse for your own satisfaction, you can certainly find room for that without incurring a significant economic burden.
It's a complicated affair, and I'm not sure if this answer was precisely what you're looking for, but I hope it has helped to make the picture clearer for you.
There is a similar question to this in the FAQ that explains how the system of punishment was intended to make the slave population easier to dominate. From /u/sowser
methods of control in the New World represent the continuation, not the beginning, of a very specific system of aggressive physical and psychological domination. Many would have seen plenty of reason to cooperate with their new owners' demands after such experiences. Once in the New World, whipping and physical beating were the main means of instilling discipline in the resistant throughout slavery's existence. What we refer to as 'whipping' might take any number of similar but slightly variant forms; birching and switching were common. Whipping could often be severe and relentless, and there are plenty of examples of white owners requiring another slave to carry out the punishment as a further means of demonstrating their authority and power; it stands to reason this likely happened even in the earliest days of slavery.
Here is the full response.