The 'brand' part actually comes from the same source as the idea of a 'brand' being a burning torch/device, as in the words 'firebrand' and �branding-iron'. The concept is that the thing concerned is so new it's as if it had just come from the furnace or blacksmith's forge. Shakespeare actually used the phrase 'fire new' in the same context.
'Spanking' is probably related to the Danish word 'spanke' which means to 'strut'. So, if something is 'spanking' it means it's showy and especially fine.