Illegal can refer to an act or an item that is considered to be against the law. For example, parking on both sides of the street is considered to be illegal, mainly because this is not allowed, and the law says that this should not be done.
When you say that something is unethical, this means that a person is doing something that is considered to be immoral or is going against what is considered to be the normal ethical code that is being followed by people.
For example, it is not really against the law to break a promise, but this is considered to be unethical, especially if the person has already said that the promise is not meant to be broken.