The human brain does not finish developing until a person is in his or her early 20's. The final stages of development are specifically related to the ability to control impulses and understand consequences. Juveniles are not as accountable for their actions as adults, even if the crimes they commit are serious. They might make very different choices once their brains are fully developed.
Children do not process information or thoughts in the same way as adults. Even those who choose to commit crime do not follow the same thought process as adults. They are simply not capable of the same rationale. Additionally, they do not have the same social maturity, which could be extremely detrimental when they are placed in an internment situation where they are surrounded by adults. It is, therefore, unfair to try them as adults.
Yes, it should be illegal to try juveniles as adults. No matter how reprehensible the crime for which they are arrested, the fact remains that juveniles have not fully formed their moral values. Many have been traumatized by the people who raised them or the environment in which they have been brought up, and such circumstances should be acknowledged by courts. Juveniles should be given extra opportunities for rehabilitation.
While most juveniles should not be tried as adults, there are some cases in which it is necessary, and a law making it illegal to do so would just hinder the process. If a juvenile is an older teen or shows that he or she is aware of the consequences of the crime committed, he or she should be tried as an adult.