If we have no free will, then is the entire legal system redundant since no one can be held accountable for anything since no one has control over their own actions?

Those like me who are compatibilists take the view that the truth of determinism would have no consequences for law and morals. Like Jonathan, I too am a compatibilist, and I agree with what he says in the italicized statement above. However, the questioner asked about the effect on the legal system of (1) the total absence of free will, not (2) the truth of determinism. I agree with Jonathan that (2) has no consequences for law and morals. But (1) does. One consequence of (1) for morals is that no actions are morally right or wrong. Furthermore, our current legal system routinely assumes that defendants are morally responsible for their actions and able to conform their conduct to standards of right and wrong. If that assumption is false, then our current legal system is corrupt, or at least unfair, assuming that it's unfair to hold people morally responsible when in fact they're not morally responsible. Is hard determinism supposed to imply that nothing is unfair? If hard determinism...

If no one can legitimately be held accountable for anything, then I think the Anglo-American legal system (the only legal system I know at all well) is worse than redundant (and strictly speaking not even redundant): it's fundamentally corrupt. Indeed, it's hard for me to imagine any legal system that doesn't presume that we have control over at least some of our actions. Even a system that punishes solely for the sake of deterrence or rehabilitation needs to presume that we can control our actions, at least sometimes, in response to examples that are meant to deter us, or as a result of programs that are meant to rehabilitate us.

Is murder illegal because its wrong? Or is murder wrong because its illegal?

Your first question -- Why is murder illegal? -- is a sociological and/or historical question about the law and therefore a question on which philosophers, as such, aren't experts. Nevertheless (!) I feel confident in saying that the answer is yes : the direction of explanation goes from moral wrongness to illegality. Murder is a form of homicide meeting various conditions, such as being intentional and being done "with malice aforethought." Why does modern society outlaw murder but not, say, an adult's listening to "Baby" by Justin Bieber? Both actions reflect badly on the agent, but only the former is regarded as a serious moral wrong. When they start making things illegal, liberal societies tend put actions meeting that description at the top of the list. Your second question is more properly philosophical, and I think the answer is clearly no . It's at least imaginable that a society's legal regime might outlaw some things but not outlaw murder. Yet murder would remain morally wrong:...

How would a legal philosopher deal with the trolley problem compared to a moral philosopher? Would he come to a conclusion that is neither switch nor not switch? That is, either choice is equally legal?

You seem to be asking about the legality of switching or declining to switch, in which case your question is best answered by a lawyer rather than a philosopher of law. I'm not sure, but the answer may depend on the jurisdiction. It may also matter whether the person in a position to switch the trolley is legally authorized to be in that position or is, instead, a trespasser or intruder. I'm not suggesting that the answer provided by the law is totally irrelevant to the morally right answer. The law on this issue, if there is any, may reveal the moral attitude that we currently take toward it, which is relevant to some extent.