Suppose I have an address with 0BTC balance. (i.e. I have the private key of it on my PC. There isn't yet anything about that address in the blockchain.)
Some other person sends 100mBTC to that address. I can see that the transaction has spread through the network but it hasn't been added to a block yet.
Because I'm overly trusting and/or in a hurry, I don't wait until it's confirmed but I immediately send another transaction that sends the 100mBTC to some other account.
If a miner first picked transaction #1, added it to a block, then added transaction #2 to the following block, both transactions would be valid. However if a miner tried to process transaction #2 first, it would be invalid.
So what would happen? Would miners bring the transactions into correct order and validate both, only validate #1 and reject #2 or reject both?