It is not true that cores are always cubical. Current Transformers and Potential Transformers have ringtype cores. Power transformers have cubical cores. The ideal transformer is to have all the magnetic flux produced by one winding linking the other. This is not attained in practical transformers. Flux that does not link both windings is called leakage flux and has the effect of adding an inductance that produces a voltage drop when there is a current. Leakage is affected by the shape of the core and by the arrangement of the windings.To reduce leakage, the core must be compact and the windings close together.
The cores used in the transformer are made up of laminated silicon steel with high permeability (to minimize eddy current losses). They are rectangular because: i) Their winding requires lesser complexity and, so equipment is cheaper; ii) They are robust and need less maintenance; iii) There is a small inflow of current when switched on; iv) Central fixing is easy. Hence, though toroidal core is better for smaller constructions and due to lesser external magnetic field interference, rectangular cores are preferred.