Why would SELECT * be magnitudes faster than SELECT foo?
The phrase ORDER BY 1 refers to different columns; in the first it will be id, in the second val.  Since id is the key it will be indexed and the order by will be a trivial amount of work.  To order by val, however, the system will have to retrieve every row, sort the complete table by val, then choose just one of those rows.

Change both queries to order by id and I think your execution times will be almost identical.