This is generally called corruption, when a politician uses their political influence to give favors and influence to family and friends.
This kind of corruption is not necessarily illegal if you do it right, but it's looked down upon because it means you're using the office for personal gain rather than the gain of your constituents.