Willie is shocked that Tom wants him to get into bed rather than lie under it, which implies that his mother made him sleep under her bed rather than giving him a bed of his own—more evidence of her abuse and neglect. When Tom warns himself not to become attached to Willie, it indicates to the reader that Tom is already getting attached.
Good night, Mr. Tom is the novel’s title; its appearance here emphasizes that the relationship between Willie and Tom will be at the heart of the novel. Tom’s contemplation of his long-dead wife’s paint box at this moment hints that he hasn’t had a meaningful emotional relationship with anyone since she and their infant son died.