Which were the first mathematical developments to state that the product of two negative numbers is a positive number, and what was their justification for this choice? I am not interested in a modern explanation for why this choice is sensible, but want to know how mathematicians from the past arrived at this convention.
Brahmagupta (598-670) was one of the first mathematicians to introduce negative numbers. He called them debts. The rule was:
The product or quotient of two debts is one fortune.
This was logical, because you have a debt of 3 by 3 people, then you have a debt by 9 people. In modern language, $3 \times -3 = -9$, however Brahmagupta wouldn't write that. So fortune times debt is debt. Fortune times fortune is a fortune. So changing fortune to debt once als changes the outcome. Therefore changing it again would result to a fortune.
Alas, we will never know. The earliest mention of negative numbers occurs in Liu Hui's c. 260 AD commentary to Chinese classic Nine Chapters on the Mathematical Art, a compendium of prescriptions for solving practical mathematical problems. The context is solution of linear systems by what we call Gaussian elimination, and the numbers are represented by red and black counting rods (contrary to the modern accounting convention red is positive):"Rods of the same name multiplied by each other make positive. Rods of different names multiplied by each other make negative". In the style of the book there is no explanation or justification for the rule. If anything, the context suggests that it was adopted because the algebra worked, not for any "intuitive" reason:"Interchanging the red and black rods in any column is immaterial. So one can make the first entries of opposite sign".
Brahmagupta's Correctly Established Doctrine of Brahma (c. 630 AD) gives the rule in the same prescription style, along with many others:"The product of a negative and a positive is negative, of two negatives positive, and of positives positive; the product of zero and a negative, of zero and a positive, or of two zeros is zero. A positive divided by a positive and negative divided by a negative is positive; a zero divided by a zero is zero...". Literally, he says "fortunes" and "debts" rather than positive and negative, but while such merchant interpretation provides intuition for addition and subtraction of debts their product makes little sense, as does $0/0=0$.
Mumford comments that even the merchant interpretation is pure speculation:"It would be wonderful to know what considerations led Indian mathematicians in the late centuries BCE or the early centuries CE to these conclusions – especially for the multiplication of negative numbers. The predominately oral transmission of knowledge in the Vedic tradition – and perhaps the difficulty of preserving perishable writing materials through yearly monsoons – has not left us with any record of these discoveries. They just appear full blown in Brahmagupta’s summary. R.Mattessich has developed at length the idea that it was the highly developed tradition of accounting which led to the full understanding of negative numbers, but unfortunately no evidence for this plausible conjecture exists".
The father of algebra, Al-Khwarizmi (c. 790-840 AD), explicitly cites Brahmagupta on negatives (and zero) in the famous Al-jabr w’al Muqabala, but he has little use for them in the geometric interpretations he favors. In the whole book he mentions them only once, when explaining the identity (in modern notation) $(a-b)(c-d)=ac-ad-bc+bd$. This might be a clue as to why he accepts the Brahmagupta’s rule, it has to hold for the last term to come up with the right sign.
Mumford's essay gives a good survey of historical struggles with the nature of negatives (which continued into the middle of 19th century!) with references and attempted reconstructions of their meaning.