When you have a bunch of objects that are not nicely arranged, select them all and choose Arrange > Make Grid... from the Menu Bar at the top of the screen.
The Grid Tool dialogue box will appear allowing you to decide how to organize the selected objects in terms of vertical rows and horizontal columns. The margin then allows you to determine spacing between them. Lastly you may choose to make oddly shaped objects "Boxed" in order to create even spacing when objects are not very squarish.
The result is a perfectly positioned set of objects.
You may also use the Make Grid tool to replicate a single object into a grid. For example, the above grid could have been creating by starting with a single black square, then using Make Grid with exactly the same options.