Bots are NOT illegal.
Remember what a "bot" is - an automated system or tool that performs an action.
When you use one of any of the thousands of automated tools or services that people all over the world (or you) have built to perform an online action automatically, most of the time you are accessing the site or service in a way that is entirely in accordance with the law and with the terms of service (TOS) of the site or service. Generally speaking, most popular automation services that automate social sites (think of Hootsuite, for instance) are following the terms of service, but could technically be viewed as a "bot."
Likewise, if you used UBot Studio to perform an action on Twitter, you are probably in accordance with the Terms of Service. Even if you compiled an executable (uBot) and then used that, you are probably still in accordance with the Terms of Service, depending on how "automated" the actions were. But, actions that bots perform are sometimes against the Terms of Service of a website or service. And sometimes, as in the case of the CAN-SPAM act, some actions that an automated system performs is even illegal.
However, as with most "illegal" actions (think of speeding and jaywalking), there are many people performing them and only a limited number of times that they are actually harmful, and an even more limited number of times that they are going to be noticed by the sites or services in question, and an even more limited number of times that they are going to be pursued by the authorities.
Bottom line - Bots and automation are almost always necessary if you are going to get ahead in online marketing. How you use them completely determines whether or not they are breaking TOS or the law.