Why insert in with is returning unexpected results?
This is an expected and documented behaviour

Quote from the manual


  Therefore, when using data-modifying statements in WITH, the order in which the specified updates actually happen is unpredictable


In your second query the database apparently chose to run t2 before t1 and thus it returns 1.

In the third query there have to be two different values, because that's what a sequence guarantees: it never generates the same number twice (unless you have enabled cycle)