First, it's important to note that this is not a crystalline solid, but rather an amorphous solid that you have: it's not a crystal structure / habit that's directing the structure that you have here! As coconut oil is composed of a mixture of different fatty acids, it's highly unlikely that you would obtain a single crystal from it -- although sometimes single components may selectively crystallize: e.g. you can observe one component of olive oil precipitate when cooled.
So we have a different process directing the structure here. It should be noted that hexagonal packing in 2D is the most efficient, hence it tends to be a natural default. But first let's look at why it's not just a continuous solid...
Typically (although water is not typical!) when a liquid solidifies, its density increases. Lauric acid, the main component in coconut oil has a density of 1.007 g/cm3 at 24 C, while at 50 C, it's density is 0.8679 g/cm3 . That means as the liquid cools and solidifies, it is also contracting. When a material contracts due to temperature differences, it can create significant stress, as exemplified with this hot Pyrex measuring cup being quickly cooled with cold water, and shattering because of the stress induced quickly cooling.
If we envision a surface contracting in 2D, there are two possible modes of contraction: either the whole sheet/surface can contract (essentially scaling down to a smaller version -- rare/unlikely), or the contraction can be localized (occurring at multiple points). Here's a figure illustrating whole-sheet contraction vs localized contraction. On average, the centres of contraction (when localized) will be equally-spaced, resulting in a Voronoi diagram which breaks the surface into polygons - if the centres are all equally spaced, the Voronoi diagram will be packed hexagons, such as in these breath figure patterns (source doi: 10.1021/la035915g).
The columnar shape is formed because there is a distinct direction of heat flow, with the material cooling from top to bottom, as shown in this figure. The result is that the joints (edges of the pologons; fissures; cracks) propagate downward as the (cooler) temperature front progresses toward the bottom of the jar. From the image posted, it appears that the joints are filled with higher-melting fatty acids.
The result of this process of cooling, contraction, and joint formation can actually be observed in nature in the form of columnar basalt (also referred to as "columnar jointing" of basalt). Examples such as Giant's Causeway in Ireland or Devil's Tower in Wyoming. You can read up a bit about columnar basalt in this post by the American Geophysical Union, or this good roundup from 2010 in Wired.