Why "double spent" can only happen if attacker controls 51% (or more) of the network compute power?
If it's a lottery why is it necessary for an attacker to have more compute power then the rest of the network? Can it have a chance to get ahead of main blockchain generation if it is just lucky?


Yes, a miner could attempt to 'get lucky' and pull of this attack with less than 51% of the hashing power. Keep in mind, if the attack fails, then the miner will have lost money attempting it. 51% is the point at which the miner should succeed on average. 

Note: mining is not a lottery by definition, it is only comparable to one in certain ways.