To be fair, the Bible says that when Jesus was dedicated in the Temple, they brought a sacrifice of two turtledoves (Luke 2:23-24), which implies that they were not well off.
Which of course is also not the same thing as saying they were either penniless or homeless. Every fool knows that “there was no room at the inn,” not that there was no money for an inn - and Mary and Joseph obviously had the means to live in Bethlehem for an extended time, since they didn’t return to Galilee immediately.
Well Joseph did work as a carpenter or wood crafter, which while it did not make them rich, at least made things bearable.