You are dealing in two different ‘dimensions’ (not quite the right word, but it conveys the idea). A physical ‘dimension’ and a spiritual ‘dimension’.
To do anything in this world, in this ‘earthly’ world, you need a body, an ‘earthly’ body. That’s why man (a spirit, created in Genesis 1) was given a body (Genesis chapter 2), formed out of ‘earth’ (aka dust).
Without a body, neither you, nor any other entity, (at all) can do anything in this earth - nothing. Angels need a body, Jesus needed a body (for this, but also for other [crucial] reasons.)
So for your question, for a physical person (Thomas) to touch Jesus, both needed a ‘body’ - because a ‘spirit’ can not be touched.
Angles have ‘spiritual bodies’, because they ‘operate’ in the spiritual world. Man’s body has flesh and blood, as man’s [bodies] ‘life’ is ‘in the blood’. Jesus’s resurrected body [only] had flesh and bone. The important point being that they all needed a ‘body’ to interact with this world.
That’s why the unclean spirits can’t rest until they can ‘operate’ through a body. [someone else’s]. Without this, they can’t do anything - at all.
MAT 12:43 *”When an unclean spirit goes out of a man, he goes through dry places, seeking rest, and finds none. *
44 *Then he says, ‘I will return to my house from which I came.’ *[snip]
The analogy of a ‘body’ being a ‘house’ for its owner is that the body is where man’s spirit resides while on this earth. Without your body, you really won’t be able to do much here on earth. :-)