Hierarchical layout tries to order the nodes in such a way that there are as few edge crossings as possible. To do so, the algorithm starts with a random ordering and subsequently tries to improve on that ordering. The randomization is a very important step to achieve good results in the general case.
To specify a ordering for the second layer, you can try to manually order the edge connection points at node A according to your needs. Then select node A and go to "Tools -> Constraints -> Port Constraints". Choose "Configuration Method" "From Sketch", select "Fix Source Port" (but not "Fix Target Port")*, and choose "Act On" "Ports at Selected Nodes". Click ok then run the hierarchical layout. If you reordered the edges only sloppily, open "Port Constraints" once again, choose "Remove all Port Constraints", click ok, run hierarchical layout once again, but this time select "Use Drawing As Sketch" on the first tab.
* This assumes that A is the source node of all edges connecting to it. If it is the target node, select "Fix Target Port" instead of "Fix Source Port".