The layers get rendered in the order they are received from the server (which is not necessarily the order in which they appear in the code). You can force one to load after the other by waiting for the KmlLayer status_changed event before setting the map property of the second.
function initialize() {
var chicago = new google.maps.LatLng(-122.365662,37.826988);
var mapOptions = {
zoom: 11,
center: chicago
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var ctaLayer = new google.maps.KmlLayer({
url: 'https://sites.google.com/site/gmaptest123/kml/nst.kml'
});
google.maps.event.addListener(ctaLayer, "status_changed", function() {
ctaLayer2.setMap(map);
});
ctaLayer.setMap(map);
var ctaLayer2 = new google.maps.KmlLayer({
url: 'https://sites.google.com/site/gmaptest123/kml/HelloKml6.kml'
});
}
google.maps.event.addDomListener(window, 'load', initialize);