It is not compulsory to give a housewarming gift. You do it because you care about the person or you want to be cordial with that person. It is generally polite to give gifts when invited to a housewarming party.