Update record column with id found in the table of an associated model
Use the FROM clause in the UPDATE. Like:

UPDATE purposes p
SET    user_id = j.user_id
FROM   journeys j
WHERE  j.purpose_id = p.id
AND    p.owner_id IS NULL
AND    j.user_id IS NOT NULL;  --  may be redundant


Ideally, you have some kind of unique index on journeys(purpose_id) to make this unambiguous. Else multiple rows might qualify.

The last predicate AND j.user_id IS NOT NULL is redundant if the column is defined NOT NULL.