Bitcoin is new technology with unique features - it is immutable ledger that holds amounts and stores transfers of these. It is immune to censorship and other attacks. It is also immune to confiscation by authorities (either direct or indirect via inflation). At the beginning (year 2009) bitcoins had no value, but the properties listed above became interesting for people so those people who weren't mining wanted some and offered first trades for fiat (dollars). So, first value was established like that. Then, this was reinforced - more people saw that bitcoins can be sold - and that the unique feats of Bitcoin are applicable to storing/transferring/keeping value.