They've got time before they have to worry about profit. Something as large as Twitter is almost definitely monetizable, so it makes sense for people to invest now on the incredibly high chance that one day it makes insane amounts of money for its owners.