Why can fuel economy be measured in square meters? With help from XKCD, which says

Miles are units of length, and gallons are volume — which is $\text{length}^3$. So $\text{gallons}/\text{mile}$ is $\frac{\text{length}^3}{\text{length}}$. That's just $\text{length}^2$.

I recently realised that the units of fuel efficiency are $\text{length}^{-2}$ (the reciprocal of which would be $\text{length}^{2}$) and I can't work out why this would be, because $\mathrm{m}^2$ is the unit of area, but fuel efficiency is completely different to this. The only reason I could think of for these units is just that they were meant to be used as a ratio; but then again, ratios are meant to be unitless (as far as I know, e.g: strain).
Please could someone explain why these units are used.
 A: It is a measure of the volume of fuel used per unit length moved.  Area doesn't come into that.

I can't work out why this would be, because m2 is the unit of area, but fuel efficiency is completely different to this

Your confusion is that you are making the association with area and not thinking outside of that that.  You have fixated on "area" and can't get past that.
This particular measure of fuel efficiency happens to have these units by definition of the measure.

ratios are meant to be unitless 

This is not correct.  Three cats per unit area is a perfectly good ratio and it's not unitless.
A: the short answer is that these units are used because they are easy for people to understand based on their everyday experience but they are missing important information to make them properly meaningful in the context of physics. 
The fundamental reason is that measuring fuel economy in miles per gallon (or litres per kilometre) in the first place isn't very physically rigorous and relies on the assumption that the 'gallons' we are talking about are gallons of fuel. Even then what we are really interested in is the energy that the fuel contains. 
Here the link between volume and energy is implied by everyday experience because we buy fuel by volume and the volume of fuel is what we notice decreasing as we drive but in terms of actual units the energy density of that fuel is left out for convenience, most people don't think of a litre of fuel as being x number of kJ of energy. 
To get properly meaningful physical units you need to know the density of the fuel and its energy density in chemical energy per unit mass (ie the difference in enthalpy between the fuel and the combustion products when burned in air). 
Fuel is sold by volume because that's the easiest thing to measure consistently, even though what you actually want is energy however it would be very difficult to consistently quote the actual energy of a litre of fuel sold on a given day at a given location. 
A properly detailed model of how much energy a car uses to travel a certain distance is quite complex and will, at the very least depend on the thermal efficiency of the engine, the acceleration profile, changes in elevation and various friction and drag coefficients. 
Note that travelling a given distance doesn't require any energy at all. The energy gets used up in accelerating (or more precisely decelerating) the mass of the car, climbing hills (ie doing work against gravity) and various frictional losses (notably aerodynamic drag) as well as the various ancillary systems of a car. 
So from a first approximation if you wanted to estimate how much energy it takes to get a car from point A to point B you would say none as it has the same kinetic energy when it arrives as when it leaves, it's only when you take into account the energy losses on the way that you get a useful figure. 
This is a different situation from say carrying a bucket of water up a hill as in this case you know that there is a certain gain in gravitational energy that you must put into the system as a bare minimum. 
A: This reminds me of another answer about units I once posted, where I made the point that units convey some contextual information about the meaning of a number, but there is also information that is not carried by the units, and sometimes that information tells you that two quantities which are measured by the same unit are neverthelss not "compatible" in some sense (e.g. they shouldn't be added to each other). In that case, one of the examples I gave was the difference between circumference and radius. Both of these are lengths, but they mean different things, and you generally shouldn't be adding them together. It would not be the craziest thing to represent these two types of length by different units, e.g. circumference-meters and radius-meters.
Fuel economy is another one of those cases where there is extra information beyond what the standard units tell you, and it might not be the craziest thing to represent that extra information with more detailed units. Specifically: suppose you measure fuel volume in cubic meters. (A liter is, of course, 0.001 cubic meters.) Consider what those cubic meters represent. You might come to realize that it's really a product of
$$\text{width-of-fuel meter}\times\text{height-of-fuel meter}\times\text{length-of-fuel meter}$$
Normally, the distinction between length, width, and height is not important, and the fact that we're talking about fuel measurements specifically is indicated by the surrounding context, so we leave those qualifiers out of the units and just say "meters". That's how you wind up reducing the unit of fuel volume to plain old cubic meters.
But in this case, when you calculate fuel economy, you wind up dividing by a completely different kind of meter: the $\text{distance-traveled meter}$. So the extra-context unit of fuel economy is
$$\frac{\text{width-of-fuel meter}\times\text{height-of-fuel meter}\times\text{length-of-fuel meter}}{\text{distance-traveled meter}}$$
And in this form, it's clear that you shouldn't really be canceling width or height or length against distance traveled, just as you shouldn't be adding circumference-meters to radius-meters. Sure, all the meters are meters, but they're all measuring different things.
That's why you probably shouldn't cancel out one of the meters from the top with the meters from the bottom and leave yourself with $\mathrm{m}^2$. You can do so as a mathematical curiosity, but you've discarded some of the physical meaning in the units, and you shouldn't be too surprised that the result you get doesn't seem very physically meaningful either.
A: As xkcd says, the inverse fuel efficiency of a vehicle is the volume of fuel consumed per distance travelled, and this is the cross-sectional area of a pipe (or trough if it makes it easer to visualise) full of fuel down which the vehicle conceptually runs, consuming the fuel in the pipe as it goes.  Obviously an inefficient vehicle will need a thicker pipe as it eats more fuel per distance travelled, and the volume of fuel it consumes is the pipe's cross-sectional area multiplied by the distance.  That's why the units are $\text{length}^2$.
And efficiency is just the reciprocal of the fuel consumed per unit distance, obviously
A: Imagine that you have a tube laid along some path and that the tube is completely filled with the fuel that you would spend to cover that path.
Area of the cross-section of that tube is the area you're asking about.
Now, if this area is bigger, the tube is thicker, which means more fuel. That is, more fuel to cover the same distance, which means lower efficiency.
Therefore, efficiency is proportional to the inverse of the area of that tube and that's why it can be measured in inverse square meters.
A: The volume in fuel efficiency was not to be used in the length unit it was meant to be used as the amount of distance run based on the amount of fuel consumed. Ratio is not necessarily dimensionless: since you gave reference to strain, I can say that the ratio of stress to strain would be the co-efficient of elasticity with the unit of Pressure, even a better example would be the
Weidemann-Franz law.
