Simply put, Nebuchadnezzar was brainwashing these young men because they would soon become leaders in his kingdom. This strategy has continued down through the ages to modern day with Communist regimes and Muslims indoctrinating many young people. If you can form the thoughts of a person early in life, you have them to influence others for potentially many years because it is easier to mold a young mind.
Daniel resolved that he would not eat food that went against what he had been taught in Hebrew tradition. Would the food actually defile him? It was more of a question of disobeying a standard God had given to the Israelites and if he lowered his standard in one area, soon other areas would follow and he would spiral downward in sin.
Two insights to consider here about Daniel&rs ...