If a new billing address is also used for shipping (the corresponding checkbox is set) Magento of course creates a record in
sales_flat_order_address for each.
Is there any reason why
customer_address_id field which keeps the reference to
customer/address entity is only saved for billing address while shipping remains NULL?
Note: The issue can be reproduced only for inserting a new address during the checkout. For existing addresses it puts references for both. Which is even more strange.
Note2: you can observe this behavior in