Because you have a concurrent read/write to a.
If you switch the two lines, the go statement still happens before execution of f begins and thus before `print(a)`. But now, it *also* happens before the write ("Within a single goroutine, reads and writes must behave as if they executed in the order specified by the program"). So the read and the write are concurrent - the go statement happens before both, but they are not ordered between them.
FTR, this should also be fairly obvious without looking at the specifics of the memory model. If you do
go f()
a = "hello world"
You start a new goroutine reading `a`, so it should be clear, that when the assignment happens, there is a separate goroutine running that might read from it at the same time.