Hello,
for the Europeans: You always have to fill up the immigration papers (it isn't a visa!) if you are travelling to the USA - neither you stay there or not! And you always have to go through the customs (and also filling up the custom papers)!
In the USA there is no transit regulation like in other countries of the world (sorry, but at this way the government will get more data information from the traveller and their travelling attitudes - they also want to get from the EU that we (EU-citizens) have to give them all the data of our credit-cards if we are travelling to the USA, that's horrible and not adequate!)! You have to know if you are travelling to the USA you will get a transparent citizen - much more than you are at Europe! But all these things are an especially discussion......
Tipp: when you are filling up the papers (you will get them in the aeroplane)...at the position "where do you stay in the USA? - destination address" please write: "In Transit to ..."
Please note: You also have to fill up the "ESTA Authorization" online, at least 72 hours before your flight goes. ...and don't wonder that it is the same paper like in the aeroplane....

...so practically you have to do it twice! But at your flight from London to Miami you will get enough time to do the papers!

Que te vaias bien!
Arambigua