You buy "something". That "something" doesn't represent any legal right for you. If you buy a NFT of an image, you won't be the copyright owner of that image. You can't stop other people from using it either. Maybe there are some exceptions, but generally you just don't get anything legally. Similarly, buying a star doesn't give you legal right on that star.
Why does doing this programatically make it different? Plus, buying a star is not inherently non-programmable. You can launch a star registry with an API. You can laucnh an NFT for stars. What makes buying a star stupid is that it doesn't represent any legal right, not that it's doesn't scale.