You’re probably having parenting issues with your widgets and panel.
Instead of having to worry about parenting, let NGUI do it for you, use NGUITools.AddChild:
GameObject squadUnit = NGUITools.AddChild(uiPanel.gameObject, new GameObject("squadUnit"+i)); // this will create the object and parent it properly
UISprite uiSpr = squadUnit.AddComponent<UISprite>();
uiSpr.atlas = atlas;
uiSpr.spriteName = "frame2";
// uiSpr.panel = uiPanel; don't need that no more
// squadUnit.transform.parent = panel.transform; nor that
And btw, sometimes widgets don’t appear even if you add them manually in-scene, if that happens just pull your panel a little bit forward. See this for more info as to why this happens (it’s a Unity thing)