First... never use Instantiate or "new GameObject".
Use NGUITools.AddChild. If you don't, then the layers won't be set properly, the parent may not be set properly, and you are very likely to start using the widget before its parent is set, which in effect will cause it to be re-parented by the system, which is not what you want. When you then go to change the parent afterwards, the widget won't know that you did so unless you call MarkParentAsChanged().
NGUITools.AddChild saves a lot of problems. So does NGUITools.AddWidget for that matter.
Oh and also... you are creating a new game object called "panel", then add a UITexture to it, which is a widget. There is no panel there. Worse yet, widgets must be children of a panel, or shit hits the fan. Note how when you create a widget in Unity via ALT+SHIFT+W or drag & drop a "Control" into the scene view in a brand-new scene the UI hierarchy gets created for you along with UIRoot?
This is important.