These lovely blooms are a reminder that the plant is closing down and entering reproduction mode rather than growth mode. It would produce the basil leaves I need to satisfy my pesto desires. It's merely a natural part of the cycle and not an indication that you did anything wrong.