The computer measures the airflow at the beginning of the intake tract (assuming you're using a MAF system) and injects fuel accordingly. So when you shift and let off the gas, your turbo is still spinning and the excess air is vented through the blow-off valve. However the computer doesn't know that that air isn't going into the combustion chamber, so while the blow-off valve is going the mixture in the combustion chamber is very rich, thus letting a lot of unburned fuel into the exhaust, where it gets ignited by the hot turbine wheel. Hence flames on shifting.
J