A tag is actually a hash. Each has a name and a value. You can't export them directly to a CSV file. Also, unless you're extremely careful, it's likely that you'll find a tag you didn't expect to find. That may because someone made a typo when creating the tag, or a tag was added that nobody remembers. So exporting all the tags for all VMs, with each VM having only one row in the CSV file requires you to have previous knowledge of ALL the tag names, or process all VMs and accumulate all the tag names so you can create an identical set of tag names for each row (whether or not the tag exists for all VMs).
Here's an example of how to go about this: export-azure-resource-groups-with-tags-to-csv