In the 19th century, Western societies were starting to get more prosperous. For the first time, food was plentiful and obesity was on the rise. The Body Mass Index was devised to keep tabs on the increasing levels of obesity in these populations. When used like this, for large groups, it is reasonably accurate.
Originally, BMI was not meant for assessing individuals. However, it is easy to calculate and requires no measurements besides height and weight. Because it is so simple, it has been used a lot to quickly determine whether someone is at a healthy weight.