Can minecraft give a computer virus?

I had minecraft downloaded into my old laptop. My laptop got a nasty Trojan malware and still isn't fixed. If I get a new laptop, and download minecraft onto that, could a virus be transferred through my minecraft account? Or should I re buy minecraft? Also, does the same apply for a steam account

No. A virus can't be transferred through your minecraft account. Same thing with Steam.

Mine craft should not give your computer a virus, so it was something else. And you can download it on a new computer and you should be fine. Just be sure you are getting minecraft from a REAL minecraft website.

As long as it was downloaded and bought off of the legitimate website, and no strange links from other players are opened on servers.

Steam will also do nothing to you. Not sure why you'd think that either of these could be at fault.