What do you suggest instead? Just showing what you think is wrong is not an idea yet. 😄
It is important to have logical horizontal and vertical grouping, so simply bunching all icons into a gapless NxM grid seems ill advised. Every time NI would add a new function (happens all the time!), all following icons would change position, probably confusing most. I'll pass. 😉
The "alignment" as you call it is deliberate and purposefully chosen. The palette layouts create logical groupings. For example, the space in the Cluster, Class, & Variant palette keeps all the casting functions together.
The current palette design is intended, including gaps for organization and adding future API VIs.