Syntactially, to do that functions as an adjunct, not a complememt. For the sake of simplicity, we can reduce the given sentences to the following:
[i] He was mean to do that.
[ii] We'd be stupid to do that.
These adjuncts restrict the domain to which the rest of the clause applies - [i] does not imply that he is or was mean as a rule: it might be that he is a very nice person generally. The property of being mean is ascribed to him only with respect to this action. Similarly, [ii] does not imply that we would be generally stupid, but only as far as this single act would be concerned.
They can be shown to modify the entire clause as they do not form a unit with the predicative adjectives, and thus cannot be used as a unit as post-head modifier in a noun phrase.
*[The man mean to do that] was my brother.
Further, this clause resists most changes, becoming unacceptable in a non-finite form.
*(Him) Being mean to do that, I broke off relations with him.
*I planned for him to be mean to do that.
In fact, even changing the verb leads to a defective result.
?He seemed mean to do that.
?We'd look stupid to do that.
Note that with the extraposed subject version of these, this would be allowed.
It seemed mean (for him) to do that.
It'd look stupid (for us) to do that.
Considering the resistance of this structure to change, it might be best to consider it idiomatic: the use of a to-infinitival as an adjunct of domain is rare otherwise.
Comparing for doing that to the above, it produces about the same range of acceptability.
He was mean for doing that.
*The man mean for doing that was my brother.
?Him being mean for doing that, I broke off relations with him.
?I planned on him being mean for doing that.
?He seemed mean for doing that.