Why is a kub that is done to kidneys?

It is an XRay. Kub is an abbreviation of the order for an xray study of the "kidneys, ureters and bladder".
Plain radiograph. KUB stands for kidney, ureter, and bladder. It is plain radiograph originally looking for calcifications or stones in kidneys , ureters, and bladder. It is also useful for detecting some bowel abnormalities such as bowel obstruction,free air in abdomen, enlargement of spleen , and regional skeletal abnormalities.
Xray. A kub is a plain film of the abdomen; it is titled "kidneys, ureter, bladder." it actually is not really the best test to look at these organs, but it was long ago named such. These organs are within the xray "field" however.