Trees are not a taxonomic group. It’s rather a description of characteristics the most important of which is having a woody trunk. For example there are tree legumes and non-tree legumes. A species of tree can therefore be more closely related to a non-tree than to other trees. However it’s totally true bamboo is not a tree. A grass could in theory however hit all the characteristics that are required to be tree and would then be considered as such, however no such grass happens to exist.
Palm trees are monocots and are therefore related to grasses, however they are not grasses themselves. Monocots are a really broad group though. Kinda like saying a certain animal is a mammal. Important distinction but still very broad.