Bitcoin was primarily used for underground purposes but it's moving away from that. The internet was arguably just used for underground activities at first and criminals took advantage of it as well like they do with any new technology, but any good idea will outgrow itself eventually when others realize it.
Bitcoin was never intended primarily for
underground purposes, like drug trade. It was created to counter the abuse of power by the government. And your perception about the internet is wrong. Internet was not designed by underworld criminals. The idea was originally developed by the United States Department of Defense.