Why is a rectangular wing planform less efficient than others?
For the same wing span, an elliptical wing planform is the most aerodynamically efficient compared to any other flat wing planform because it has the lowest induced drag. Note that we are comparing only aerodynamics here. Things get much more nuanced once you couple structural weights, stability &amp; control for a global efficiency (also see @Peter's answer).

1. Induced drag

So restricting to aerodynamics, elliptical wing planform is the most efficient because it has the lowest induced drag. Induced drag is produced because wings have finite span, and therefore one section of the wing distorts the flow on another section, creating downwash. This downwash distorts the lift vector on each wing section, thereby converting what otherwise would be lift into drag.

2. Downwash

Now that you understand induced drag has to do with downwash on each span section, you must appreciate that the distribution of downwash over the span is important to the induced drag generation. Distribution of downwash is dictated completely by the lift distribution over the wing (and vice-versa), which is in turn, dictated by the shape of the wing planform.

3. Lift distribution

For an elliptical wing planform, we can prove that it also generates an elliptical lift distribution. When you do the math of integrating all the sectional induced drag from the downwash and sectional lift, elliptical lift distribution has the lowest induced drag.

The following figures show the distributions of elliptical wing, rectangular wing (taper = 1) and tapered wing (taper = 0.5), with aspect ratio 8 and all producing a total $C_L=0.4$. Here, Ref Cl is the actual lift coefficient distribution that we've talking about, but multiplied by span length; Local Cl is the lift coefficient produced at each wing section, as if it's standalone airfoil; $\alpha_i$ is the downwash distribution in deg. The data are generated from Lifting Line Theory.







As you can see, elliptical distribution maintains a constant downwash, compare that to a wider and more varied one for a rectangular wing. Also, a taper of 0.5 gets you fairly close to the elliptical lift and downwash distributions, especially when you consider the $\frac{C_L}{C_{D_i}}$, which is 62.8 for elliptical and 61.8 for tapered.